From c4441f2e97d38d4415838567c39ec2b1d7ebfa16 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 23 Jul 2018 17:05:05 +0000 Subject: [PATCH 1/5] Generated from 1d20390e98d770c06e5e0977ee31eeac095675af Bump storage management Node.js package version to 5.1.1-preview --- lib/services/storageManagement2/lib/models/index.d.ts | 4 ++-- lib/services/storageManagement2/lib/models/restriction.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/services/storageManagement2/lib/models/index.d.ts b/lib/services/storageManagement2/lib/models/index.d.ts index 70e282db58..2c2a3db422 100644 --- a/lib/services/storageManagement2/lib/models/index.d.ts +++ b/lib/services/storageManagement2/lib/models/index.d.ts @@ -159,9 +159,9 @@ export interface SKUCapability { * is set to location. This would be different locations where the SKU is * restricted. * @member {string} [reasonCode] The reason for the restriction. As of now this - * can be “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the + * can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the * SKU has requiredQuotas parameter as the subscription does not belong to that - * quota. The “NotAvailableForSubscription” is related to capacity at DC. + * quota. The "NotAvailableForSubscription" is related to capacity at DC. * Possible values include: 'QuotaId', 'NotAvailableForSubscription' */ export interface Restriction { diff --git a/lib/services/storageManagement2/lib/models/restriction.js b/lib/services/storageManagement2/lib/models/restriction.js index 425ff0dbd8..e5a54d02ec 100644 --- a/lib/services/storageManagement2/lib/models/restriction.js +++ b/lib/services/storageManagement2/lib/models/restriction.js @@ -23,9 +23,9 @@ class Restriction { * type is set to location. This would be different locations where the SKU * is restricted. * @member {string} [reasonCode] The reason for the restriction. As of now - * this can be “QuotaId” or “NotAvailableForSubscription”. Quota Id is set + * this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set * when the SKU has requiredQuotas parameter as the subscription does not - * belong to that quota. The “NotAvailableForSubscription” is related to + * belong to that quota. The "NotAvailableForSubscription" is related to * capacity at DC. Possible values include: 'QuotaId', * 'NotAvailableForSubscription' */ From da850647924c3f7ae7a4ebba4172ed2d2b9ebba7 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 20 Aug 2018 18:01:33 +0000 Subject: [PATCH 2/5] Generated from 57c78a80313de40cefe45d1e4e31738825818895 Update storage management Node.js package version to 5.2.0 --- .../storageManagement2/lib/models/index.d.ts | 7 +++++-- .../storageManagement2/lib/models/operation.js | 1 + .../lib/models/operationDisplay.js | 8 ++++++++ .../lib/models/serviceSasParameters.js | 8 ++++---- .../storageManagement2/lib/operations/index.d.ts | 8 ++++---- .../lib/operations/storageAccounts.js | 12 ++++++------ .../lib/storageManagementClient.d.ts | 6 +++--- .../lib/storageManagementClient.js | 6 +++--- 8 files changed, 34 insertions(+), 22 deletions(-) diff --git a/lib/services/storageManagement2/lib/models/index.d.ts b/lib/services/storageManagement2/lib/models/index.d.ts index 2c2a3db422..a66c7ad431 100644 --- a/lib/services/storageManagement2/lib/models/index.d.ts +++ b/lib/services/storageManagement2/lib/models/index.d.ts @@ -26,11 +26,13 @@ export { CloudError } from 'ms-rest-azure'; * @member {string} [resource] Resource on which the operation is performed * etc. * @member {string} [operation] Type of operation: get, read, delete, etc. + * @member {string} [description] Description of the operation. */ export interface OperationDisplay { provider?: string; resource?: string; operation?: string; + description?: string; } /** @@ -104,6 +106,7 @@ export interface ServiceSpecification { * performed etc. * @member {string} [display.operation] Type of operation: get, read, delete, * etc. + * @member {string} [display.description] Description of the operation. * @member {string} [origin] The origin of operations. * @member {object} [serviceSpecification] One property of operation, include * metric specifications. @@ -1071,7 +1074,7 @@ export interface ListAccountSasResponse { * * @member {string} canonicalizedResource The canonical path to the signed * resource. - * @member {string} resource The signed services accessible with the service + * @member {string} [resource] The signed services accessible with the service * SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). * Possible values include: 'b', 'c', 'f', 's' * @member {string} [permissions] The signed permissions for the service SAS. @@ -1107,7 +1110,7 @@ export interface ListAccountSasResponse { */ export interface ServiceSasParameters { canonicalizedResource: string; - resource: string; + resource?: string; permissions?: string; iPAddressOrRange?: string; protocols?: string; diff --git a/lib/services/storageManagement2/lib/models/operation.js b/lib/services/storageManagement2/lib/models/operation.js index bed9cc7725..a712e68951 100644 --- a/lib/services/storageManagement2/lib/models/operation.js +++ b/lib/services/storageManagement2/lib/models/operation.js @@ -26,6 +26,7 @@ class Operation { * performed etc. * @member {string} [display.operation] Type of operation: get, read, delete, * etc. + * @member {string} [display.description] Description of the operation. * @member {string} [origin] The origin of operations. * @member {object} [serviceSpecification] One property of operation, include * metric specifications. diff --git a/lib/services/storageManagement2/lib/models/operationDisplay.js b/lib/services/storageManagement2/lib/models/operationDisplay.js index b723017226..74ebb33f21 100644 --- a/lib/services/storageManagement2/lib/models/operationDisplay.js +++ b/lib/services/storageManagement2/lib/models/operationDisplay.js @@ -21,6 +21,7 @@ class OperationDisplay { * @member {string} [resource] Resource on which the operation is performed * etc. * @member {string} [operation] Type of operation: get, read, delete, etc. + * @member {string} [description] Description of the operation. */ constructor() { } @@ -59,6 +60,13 @@ class OperationDisplay { type: { name: 'String' } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } } } } diff --git a/lib/services/storageManagement2/lib/models/serviceSasParameters.js b/lib/services/storageManagement2/lib/models/serviceSasParameters.js index e883c839a9..e2ff3bcfde 100644 --- a/lib/services/storageManagement2/lib/models/serviceSasParameters.js +++ b/lib/services/storageManagement2/lib/models/serviceSasParameters.js @@ -19,9 +19,9 @@ class ServiceSasParameters { * Create a ServiceSasParameters. * @member {string} canonicalizedResource The canonical path to the signed * resource. - * @member {string} resource The signed services accessible with the service - * SAS. Possible values include: Blob (b), Container (c), File (f), Share - * (s). Possible values include: 'b', 'c', 'f', 's' + * @member {string} [resource] The signed services accessible with the + * service SAS. Possible values include: Blob (b), Container (c), File (f), + * Share (s). Possible values include: 'b', 'c', 'f', 's' * @member {string} [permissions] The signed permissions for the service SAS. * Possible values include: Read (r), Write (w), Delete (d), List (l), Add * (a), Create (c), Update (u) and Process (p). Possible values include: 'r', @@ -78,7 +78,7 @@ class ServiceSasParameters { } }, resource: { - required: true, + required: false, serializedName: 'signedResource', type: { name: 'String' diff --git a/lib/services/storageManagement2/lib/operations/index.d.ts b/lib/services/storageManagement2/lib/operations/index.d.ts index fc1091e7e3..765a314eec 100644 --- a/lib/services/storageManagement2/lib/operations/index.d.ts +++ b/lib/services/storageManagement2/lib/operations/index.d.ts @@ -1282,8 +1282,8 @@ export interface StorageAccounts { * @param {string} parameters.canonicalizedResource The canonical path to the * signed resource. * - * @param {string} parameters.resource The signed services accessible with the - * service SAS. Possible values include: Blob (b), Container (c), File (f), + * @param {string} [parameters.resource] The signed services accessible with + * the service SAS. Possible values include: Blob (b), Container (c), File (f), * Share (s). Possible values include: 'b', 'c', 'f', 's' * * @param {string} [parameters.permissions] The signed permissions for the @@ -1362,8 +1362,8 @@ export interface StorageAccounts { * @param {string} parameters.canonicalizedResource The canonical path to the * signed resource. * - * @param {string} parameters.resource The signed services accessible with the - * service SAS. Possible values include: Blob (b), Container (c), File (f), + * @param {string} [parameters.resource] The signed services accessible with + * the service SAS. Possible values include: Blob (b), Container (c), File (f), * Share (s). Possible values include: 'b', 'c', 'f', 's' * * @param {string} [parameters.permissions] The signed permissions for the diff --git a/lib/services/storageManagement2/lib/operations/storageAccounts.js b/lib/services/storageManagement2/lib/operations/storageAccounts.js index f8ecd115bb..b50f9a056c 100644 --- a/lib/services/storageManagement2/lib/operations/storageAccounts.js +++ b/lib/services/storageManagement2/lib/operations/storageAccounts.js @@ -1997,8 +1997,8 @@ function _listAccountSAS(resourceGroupName, accountName, parameters, options, ca * @param {string} parameters.canonicalizedResource The canonical path to the * signed resource. * - * @param {string} parameters.resource The signed services accessible with the - * service SAS. Possible values include: Blob (b), Container (c), File (f), + * @param {string} [parameters.resource] The signed services accessible with + * the service SAS. Possible values include: Blob (b), Container (c), File (f), * Share (s). Possible values include: 'b', 'c', 'f', 's' * * @param {string} [parameters.permissions] The signed permissions for the @@ -4554,8 +4554,8 @@ class StorageAccounts { * @param {string} parameters.canonicalizedResource The canonical path to the * signed resource. * - * @param {string} parameters.resource The signed services accessible with the - * service SAS. Possible values include: Blob (b), Container (c), File (f), + * @param {string} [parameters.resource] The signed services accessible with + * the service SAS. Possible values include: Blob (b), Container (c), File (f), * Share (s). Possible values include: 'b', 'c', 'f', 's' * * @param {string} [parameters.permissions] The signed permissions for the @@ -4646,8 +4646,8 @@ class StorageAccounts { * @param {string} parameters.canonicalizedResource The canonical path to the * signed resource. * - * @param {string} parameters.resource The signed services accessible with the - * service SAS. Possible values include: Blob (b), Container (c), File (f), + * @param {string} [parameters.resource] The signed services accessible with + * the service SAS. Possible values include: Blob (b), Container (c), File (f), * Share (s). Possible values include: 'b', 'c', 'f', 's' * * @param {string} [parameters.permissions] The signed permissions for the diff --git a/lib/services/storageManagement2/lib/storageManagementClient.d.ts b/lib/services/storageManagement2/lib/storageManagementClient.d.ts index 328782dcf9..3d12a541e2 100644 --- a/lib/services/storageManagement2/lib/storageManagementClient.d.ts +++ b/lib/services/storageManagement2/lib/storageManagementClient.d.ts @@ -34,11 +34,11 @@ export default class StorageManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); diff --git a/lib/services/storageManagement2/lib/storageManagementClient.js b/lib/services/storageManagement2/lib/storageManagementClient.js index 8e4064c121..9a3fda0a16 100644 --- a/lib/services/storageManagement2/lib/storageManagementClient.js +++ b/lib/services/storageManagement2/lib/storageManagementClient.js @@ -34,9 +34,9 @@ class StorageManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { From d270d64e48aee608df787207fd119fe74f03585b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 20 Aug 2018 20:03:47 +0000 Subject: [PATCH 3/5] Generated from 8d0de703352b395710cd0d8ebe0c6e4ee58ecb13 Change storage management Node.js license and package.json to be generated --- lib/services/storageManagement2/LICENSE.txt | 42 ++++++++++---------- lib/services/storageManagement2/package.json | 38 +++++------------- 2 files changed, 31 insertions(+), 49 deletions(-) diff --git a/lib/services/storageManagement2/LICENSE.txt b/lib/services/storageManagement2/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/storageManagement2/LICENSE.txt +++ b/lib/services/storageManagement2/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 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. \ No newline at end of file +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/storageManagement2/package.json b/lib/services/storageManagement2/package.json index f69d98d2ab..446763221f 100644 --- a/lib/services/storageManagement2/package.json +++ b/lib/services/storageManagement2/package.json @@ -1,43 +1,25 @@ { "name": "azure-arm-storage", "author": "Microsoft Corporation", - "contributors": [ - "Jason, Yang ", - "Gerner, Emily ", - "Wang, Jun ", - "Huang, Pengfei ", - "Shintre, Amol ", - "Onalan, Alp ", - "Lee, Hyonho ", - "Wang, Yugang ", - "Zavery, Amar " - ], - "version": "5.1.0-preview", - "description": "Microsoft Azure Storage Resource Provider Management Client Library for Node", - "tags": [ - "azure", - "sdk" - ], + "description": "StorageManagementClient Library with typescript type definitions for node", + "version": "5.2.0", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, "keywords": [ "node", "azure" ], + "license": "MIT", "main": "./lib/storageManagementClient.js", "types": "./lib/storageManagementClient.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } From 019204b6556bcc77c60b170a05a3b197b5ac8853 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 25 Sep 2018 16:49:42 +0000 Subject: [PATCH 4/5] Generated from 9099682e3d0d5f0fbffbeba4a1a21568e3e300bc Add azure-sdk-for-js to storage/resource-manager/readme.md and add readme.typescript.md --- .../lib/models/encryption.js | 2 - .../lib/models/encryptionServices.js | 2 - .../models/immutabilityPolicyProperties.js | 2 - .../storageManagement2/lib/models/index.d.ts | 116 +- .../storageManagement2/lib/models/index.js | 4 +- .../lib/models/legalHoldProperties.js | 2 - .../lib/models/listContainerItems.js | 2 - .../lib/models/metricSpecification.js | 2 - .../lib/models/networkRuleSet.js | 2 - .../lib/models/operation.js | 2 - .../lib/models/serviceSpecification.js | 2 - .../storageManagement2/lib/models/sku.js | 12 +- .../lib/models/storageAccount.js | 25 +- .../models/storageAccountCreateParameters.js | 28 +- .../models/storageAccountListKeysResult.js | 2 - .../models/storageAccountUpdateParameters.js | 29 +- .../storageManagement2/lib/models/usage.js | 2 - .../lib/operations/blobContainers.js | 144 +- .../lib/operations/index.d.ts | 532 +++---- .../lib/operations/index.js | 1 + .../lib/operations/managementPolicies.js | 862 ++++++++++ .../lib/operations/operations.js | 12 +- .../storageManagement2/lib/operations/skus.js | 12 +- .../lib/operations/storageAccounts.js | 1386 +++-------------- .../lib/operations/usages.js | 239 +-- .../lib/storageManagementClient.d.ts | 3 +- .../lib/storageManagementClient.js | 2 +- 27 files changed, 1524 insertions(+), 1905 deletions(-) create mode 100644 lib/services/storageManagement2/lib/operations/managementPolicies.js diff --git a/lib/services/storageManagement2/lib/models/encryption.js b/lib/services/storageManagement2/lib/models/encryption.js index 721130d323..6e1e6b1eb6 100644 --- a/lib/services/storageManagement2/lib/models/encryption.js +++ b/lib/services/storageManagement2/lib/models/encryption.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The encryption settings on the storage account. * diff --git a/lib/services/storageManagement2/lib/models/encryptionServices.js b/lib/services/storageManagement2/lib/models/encryptionServices.js index a4f1f045c5..8701f4d24c 100644 --- a/lib/services/storageManagement2/lib/models/encryptionServices.js +++ b/lib/services/storageManagement2/lib/models/encryptionServices.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A list of services that support encryption. * diff --git a/lib/services/storageManagement2/lib/models/immutabilityPolicyProperties.js b/lib/services/storageManagement2/lib/models/immutabilityPolicyProperties.js index 50016accd7..b08be3ae15 100644 --- a/lib/services/storageManagement2/lib/models/immutabilityPolicyProperties.js +++ b/lib/services/storageManagement2/lib/models/immutabilityPolicyProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties of an ImmutabilityPolicy of a blob container. * diff --git a/lib/services/storageManagement2/lib/models/index.d.ts b/lib/services/storageManagement2/lib/models/index.d.ts index a66c7ad431..e346d22de5 100644 --- a/lib/services/storageManagement2/lib/models/index.d.ts +++ b/lib/services/storageManagement2/lib/models/index.d.ts @@ -182,13 +182,14 @@ export interface Restriction { * @member {string} name Gets or sets the sku name. Required for account * creation; optional for update. Note that in older versions, sku name was * called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS' * @member {string} [tier] Gets the sku tier. This is based on the SKU name. * Possible values include: 'Standard', 'Premium' * @member {string} [resourceType] The type of the resource, usually it is * 'storageAccounts'. * @member {string} [kind] Indicates the type of storage account. Possible - * values include: 'Storage', 'StorageV2', 'BlobStorage' + * values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * @member {array} [locations] The set of locations that the SKU is available. * This will be supported and registered Azure Geo Regions (e.g. West US, East * US, Southeast Asia, etc.). @@ -464,13 +465,14 @@ export interface Identity { * @member {string} [sku.name] Gets or sets the sku name. Required for account * creation; optional for update. Note that in older versions, sku name was * called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS' * @member {string} [sku.tier] Gets the sku tier. This is based on the SKU * name. Possible values include: 'Standard', 'Premium' * @member {string} [sku.resourceType] The type of the resource, usually it is * 'storageAccounts'. * @member {string} [sku.kind] Indicates the type of storage account. Possible - * values include: 'Storage', 'StorageV2', 'BlobStorage' + * values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * @member {array} [sku.locations] The set of locations that the SKU is * available. This will be supported and registered Azure Geo Regions (e.g. * West US, East US, Southeast Asia, etc.). @@ -480,7 +482,8 @@ export interface Identity { * @member {array} [sku.restrictions] The restrictions because of which SKU * cannot be used. This is empty if there are no restrictions. * @member {string} kind Required. Indicates the type of storage account. - * Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * @member {string} location Required. Gets or sets the location of the * resource. This will be one of the supported and registered Azure Geo Regions * (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource @@ -567,10 +570,12 @@ export interface Identity { * @member {string} [accessTier] Required for storage accounts where kind = * BlobStorage. The access tier used for billing. Possible values include: * 'Hot', 'Cool' + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to - * storage service if sets to true. Default value: false . + * storage service if sets to true. * @member {boolean} [isHnsEnabled] Account HierarchicalNamespace enabled if - * sets to true. Default value: false . + * sets to true. */ export interface StorageAccountCreateParameters { sku: Sku; @@ -582,6 +587,7 @@ export interface StorageAccountCreateParameters { encryption?: Encryption; networkRuleSet?: NetworkRuleSet; accessTier?: string; + enableAzureFilesAadIntegration?: boolean; enableHttpsTrafficOnly?: boolean; isHnsEnabled?: boolean; } @@ -649,13 +655,14 @@ export interface TrackedResource extends Resource { * @member {string} [sku.name] Gets or sets the sku name. Required for account * creation; optional for update. Note that in older versions, sku name was * called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS' * @member {string} [sku.tier] Gets the sku tier. This is based on the SKU * name. Possible values include: 'Standard', 'Premium' * @member {string} [sku.resourceType] The type of the resource, usually it is * 'storageAccounts'. * @member {string} [sku.kind] Indicates the type of storage account. Possible - * values include: 'Storage', 'StorageV2', 'BlobStorage' + * values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * @member {array} [sku.locations] The set of locations that the SKU is * available. This will be supported and registered Azure Geo Regions (e.g. * West US, East US, Southeast Asia, etc.). @@ -665,7 +672,7 @@ export interface TrackedResource extends Resource { * @member {array} [sku.restrictions] The restrictions because of which SKU * cannot be used. This is empty if there are no restrictions. * @member {string} [kind] Gets the Kind. Possible values include: 'Storage', - * 'StorageV2', 'BlobStorage' + * 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' * @member {object} [identity] The identity of the resource. * @member {string} [identity.principalId] The principal ID of resource * identity. @@ -768,8 +775,10 @@ export interface TrackedResource extends Resource { * @member {string} [accessTier] Required for storage accounts where kind = * BlobStorage. The access tier used for billing. Possible values include: * 'Hot', 'Cool' + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to - * storage service if sets to true. Default value: false . + * storage service if sets to true. * @member {object} [networkRuleSet] Network rule set * @member {string} [networkRuleSet.bypass] Specifies whether traffic is * bypassed for Logging/Metrics/AzureServices. Possible values are any @@ -783,7 +792,7 @@ export interface TrackedResource extends Resource { * of allow or deny when no other rules match. Possible values include: * 'Allow', 'Deny' * @member {boolean} [isHnsEnabled] Account HierarchicalNamespace enabled if - * sets to true. Default value: false . + * sets to true. */ export interface StorageAccount extends TrackedResource { readonly sku?: Sku; @@ -801,6 +810,7 @@ export interface StorageAccount extends TrackedResource { readonly secondaryEndpoints?: Endpoints; readonly encryption?: Encryption; readonly accessTier?: string; + enableAzureFilesAadIntegration?: boolean; enableHttpsTrafficOnly?: boolean; readonly networkRuleSet?: NetworkRuleSet; isHnsEnabled?: boolean; @@ -857,18 +867,19 @@ export interface StorageAccountRegenerateKeyParameters { * properties. * * @member {object} [sku] Gets or sets the SKU name. Note that the SKU name - * cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those - * sku names be updated to any other value. + * cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can + * accounts of those sku names be updated to any other value. * @member {string} [sku.name] Gets or sets the sku name. Required for account * creation; optional for update. Note that in older versions, sku name was * called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS' * @member {string} [sku.tier] Gets the sku tier. This is based on the SKU * name. Possible values include: 'Standard', 'Premium' * @member {string} [sku.resourceType] The type of the resource, usually it is * 'storageAccounts'. * @member {string} [sku.kind] Indicates the type of storage account. Possible - * values include: 'Storage', 'StorageV2', 'BlobStorage' + * values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * @member {array} [sku.locations] The set of locations that the SKU is * available. This will be supported and registered Azure Geo Regions (e.g. * West US, East US, Southeast Asia, etc.). @@ -945,8 +956,10 @@ export interface StorageAccountRegenerateKeyParameters { * @member {string} [accessTier] Required for storage accounts where kind = * BlobStorage. The access tier used for billing. Possible values include: * 'Hot', 'Cool' + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to - * storage service if sets to true. Default value: false . + * storage service if sets to true. * @member {object} [networkRuleSet] Network rule set * @member {string} [networkRuleSet.bypass] Specifies whether traffic is * bypassed for Logging/Metrics/AzureServices. Possible values are any @@ -961,7 +974,7 @@ export interface StorageAccountRegenerateKeyParameters { * 'Allow', 'Deny' * @member {string} [kind] Optional. Indicates the type of storage account. * Currently only StorageV2 value supported by server. Possible values include: - * 'Storage', 'StorageV2', 'BlobStorage' + * 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' */ export interface StorageAccountUpdateParameters { sku?: Sku; @@ -970,6 +983,7 @@ export interface StorageAccountUpdateParameters { customDomain?: CustomDomain; encryption?: Encryption; accessTier?: string; + enableAzureFilesAadIntegration?: boolean; enableHttpsTrafficOnly?: boolean; networkRuleSet?: NetworkRuleSet; kind?: string; @@ -1142,39 +1156,6 @@ export interface ListServiceSasResponse { readonly serviceSasToken?: string; } -/** - * @class - * Initializes a new instance of the StorageAccountManagementPolicies class. - * @constructor - * The Get Storage Account ManagementPolicies operation response. - * - * @member {object} [policy] The Storage Account ManagementPolicies Rules, in - * JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * @member {date} [lastModifiedTime] Returns the date and time the - * ManagementPolicies was last modified. - */ -export interface StorageAccountManagementPolicies extends Resource { - policy?: any; - readonly lastModifiedTime?: Date; -} - -/** - * @class - * Initializes a new instance of the ManagementPoliciesRulesSetParameter class. - * @constructor - * The Storage Account ManagementPolicies Rules, in JSON format. See more - * details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @member {object} [policy] The Storage Account ManagementPolicies Rules, in - * JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - */ -export interface ManagementPoliciesRulesSetParameter { - policy?: any; -} - /** * @class * Initializes a new instance of the ProxyResource class. @@ -1465,6 +1446,39 @@ export interface ListContainerItems { value?: ListContainerItem[]; } +/** + * @class + * Initializes a new instance of the StorageAccountManagementPolicies class. + * @constructor + * The Get Storage Account ManagementPolicies operation response. + * + * @member {object} [policy] The Storage Account ManagementPolicies Rules, in + * JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @member {date} [lastModifiedTime] Returns the date and time the + * ManagementPolicies was last modified. + */ +export interface StorageAccountManagementPolicies extends Resource { + policy?: any; + readonly lastModifiedTime?: Date; +} + +/** + * @class + * Initializes a new instance of the ManagementPoliciesRulesSetParameter class. + * @constructor + * The Storage Account ManagementPolicies Rules, in JSON format. See more + * details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @member {object} [policy] The Storage Account ManagementPolicies Rules, in + * JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ +export interface ManagementPoliciesRulesSetParameter { + policy?: any; +} + /** * @class diff --git a/lib/services/storageManagement2/lib/models/index.js b/lib/services/storageManagement2/lib/models/index.js index a1981fb725..4d2443cbe9 100644 --- a/lib/services/storageManagement2/lib/models/index.js +++ b/lib/services/storageManagement2/lib/models/index.js @@ -52,8 +52,6 @@ exports.AccountSasParameters = require('./accountSasParameters'); exports.ListAccountSasResponse = require('./listAccountSasResponse'); exports.ServiceSasParameters = require('./serviceSasParameters'); exports.ListServiceSasResponse = require('./listServiceSasResponse'); -exports.StorageAccountManagementPolicies = require('./storageAccountManagementPolicies'); -exports.ManagementPoliciesRulesSetParameter = require('./managementPoliciesRulesSetParameter'); exports.ProxyResource = require('./proxyResource'); exports.AzureEntityResource = require('./azureEntityResource'); exports.UpdateHistoryProperty = require('./updateHistoryProperty'); @@ -65,6 +63,8 @@ exports.ImmutabilityPolicy = require('./immutabilityPolicy'); exports.LegalHold = require('./legalHold'); exports.ListContainerItem = require('./listContainerItem'); exports.ListContainerItems = require('./listContainerItems'); +exports.StorageAccountManagementPolicies = require('./storageAccountManagementPolicies'); +exports.ManagementPoliciesRulesSetParameter = require('./managementPoliciesRulesSetParameter'); exports.OperationListResult = require('./operationListResult'); exports.StorageSkuListResult = require('./storageSkuListResult'); exports.StorageAccountListResult = require('./storageAccountListResult'); diff --git a/lib/services/storageManagement2/lib/models/legalHoldProperties.js b/lib/services/storageManagement2/lib/models/legalHoldProperties.js index 7a7dbb5bc9..c23de6f89d 100644 --- a/lib/services/storageManagement2/lib/models/legalHoldProperties.js +++ b/lib/services/storageManagement2/lib/models/legalHoldProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The LegalHold property of a blob container. * diff --git a/lib/services/storageManagement2/lib/models/listContainerItems.js b/lib/services/storageManagement2/lib/models/listContainerItems.js index 7b54b0a04e..d422c89d9c 100644 --- a/lib/services/storageManagement2/lib/models/listContainerItems.js +++ b/lib/services/storageManagement2/lib/models/listContainerItems.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of blob containers. * diff --git a/lib/services/storageManagement2/lib/models/metricSpecification.js b/lib/services/storageManagement2/lib/models/metricSpecification.js index ab8826c267..82d65375da 100644 --- a/lib/services/storageManagement2/lib/models/metricSpecification.js +++ b/lib/services/storageManagement2/lib/models/metricSpecification.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Metric specification of operation. * diff --git a/lib/services/storageManagement2/lib/models/networkRuleSet.js b/lib/services/storageManagement2/lib/models/networkRuleSet.js index ada19ba007..d83e5523f4 100644 --- a/lib/services/storageManagement2/lib/models/networkRuleSet.js +++ b/lib/services/storageManagement2/lib/models/networkRuleSet.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Network rule set * diff --git a/lib/services/storageManagement2/lib/models/operation.js b/lib/services/storageManagement2/lib/models/operation.js index a712e68951..ae1dc12624 100644 --- a/lib/services/storageManagement2/lib/models/operation.js +++ b/lib/services/storageManagement2/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Storage REST API operation definition. * diff --git a/lib/services/storageManagement2/lib/models/serviceSpecification.js b/lib/services/storageManagement2/lib/models/serviceSpecification.js index 259e4b03e6..c55818490d 100644 --- a/lib/services/storageManagement2/lib/models/serviceSpecification.js +++ b/lib/services/storageManagement2/lib/models/serviceSpecification.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * One property of operation, include metric specifications. * diff --git a/lib/services/storageManagement2/lib/models/sku.js b/lib/services/storageManagement2/lib/models/sku.js index dbde23f3ca..2e54115162 100644 --- a/lib/services/storageManagement2/lib/models/sku.js +++ b/lib/services/storageManagement2/lib/models/sku.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The SKU of the storage account. * @@ -22,13 +20,15 @@ class Sku { * @member {string} name Gets or sets the sku name. Required for account * creation; optional for update. Note that in older versions, sku name was * called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * @member {string} [tier] Gets the sku tier. This is based on the SKU name. * Possible values include: 'Standard', 'Premium' * @member {string} [resourceType] The type of the resource, usually it is * 'storageAccounts'. * @member {string} [kind] Indicates the type of storage account. Possible - * values include: 'Storage', 'StorageV2', 'BlobStorage' + * values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * @member {array} [locations] The set of locations that the SKU is * available. This will be supported and registered Azure Geo Regions (e.g. * West US, East US, Southeast Asia, etc.). @@ -59,7 +59,7 @@ class Sku { serializedName: 'name', type: { name: 'Enum', - allowedValues: [ 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' ] + allowedValues: [ 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS' ] } }, tier: { @@ -85,7 +85,7 @@ class Sku { serializedName: 'kind', type: { name: 'Enum', - allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage' ] + allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' ] } }, locations: { diff --git a/lib/services/storageManagement2/lib/models/storageAccount.js b/lib/services/storageManagement2/lib/models/storageAccount.js index 536c440ce9..8ff0c24b3a 100644 --- a/lib/services/storageManagement2/lib/models/storageAccount.js +++ b/lib/services/storageManagement2/lib/models/storageAccount.js @@ -24,13 +24,15 @@ class StorageAccount extends models['TrackedResource'] { * @member {string} [sku.name] Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku * name was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * @member {string} [sku.tier] Gets the sku tier. This is based on the SKU * name. Possible values include: 'Standard', 'Premium' * @member {string} [sku.resourceType] The type of the resource, usually it * is 'storageAccounts'. * @member {string} [sku.kind] Indicates the type of storage account. - * Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * @member {array} [sku.locations] The set of locations that the SKU is * available. This will be supported and registered Azure Geo Regions (e.g. * West US, East US, Southeast Asia, etc.). @@ -40,7 +42,7 @@ class StorageAccount extends models['TrackedResource'] { * @member {array} [sku.restrictions] The restrictions because of which SKU * cannot be used. This is empty if there are no restrictions. * @member {string} [kind] Gets the Kind. Possible values include: 'Storage', - * 'StorageV2', 'BlobStorage' + * 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' * @member {object} [identity] The identity of the resource. * @member {string} [identity.principalId] The principal ID of resource * identity. @@ -148,8 +150,10 @@ class StorageAccount extends models['TrackedResource'] { * @member {string} [accessTier] Required for storage accounts where kind = * BlobStorage. The access tier used for billing. Possible values include: * 'Hot', 'Cool' + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to - * storage service if sets to true. Default value: false . + * storage service if sets to true. * @member {object} [networkRuleSet] Network rule set * @member {string} [networkRuleSet.bypass] Specifies whether traffic is * bypassed for Logging/Metrics/AzureServices. Possible values are any @@ -163,7 +167,7 @@ class StorageAccount extends models['TrackedResource'] { * action of allow or deny when no other rules match. Possible values * include: 'Allow', 'Deny' * @member {boolean} [isHnsEnabled] Account HierarchicalNamespace enabled if - * sets to true. Default value: false . + * sets to true. */ constructor() { super(); @@ -243,7 +247,7 @@ class StorageAccount extends models['TrackedResource'] { serializedName: 'kind', type: { name: 'Enum', - allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage' ] + allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' ] } }, identity: { @@ -358,10 +362,16 @@ class StorageAccount extends models['TrackedResource'] { allowedValues: [ 'Hot', 'Cool' ] } }, + enableAzureFilesAadIntegration: { + required: false, + serializedName: 'properties.azureFilesAadIntegration', + type: { + name: 'Boolean' + } + }, enableHttpsTrafficOnly: { required: false, serializedName: 'properties.supportsHttpsTrafficOnly', - defaultValue: false, type: { name: 'Boolean' } @@ -378,7 +388,6 @@ class StorageAccount extends models['TrackedResource'] { isHnsEnabled: { required: false, serializedName: 'properties.isHnsEnabled', - defaultValue: false, type: { name: 'Boolean' } diff --git a/lib/services/storageManagement2/lib/models/storageAccountCreateParameters.js b/lib/services/storageManagement2/lib/models/storageAccountCreateParameters.js index fbe0d895aa..9d8a800575 100644 --- a/lib/services/storageManagement2/lib/models/storageAccountCreateParameters.js +++ b/lib/services/storageManagement2/lib/models/storageAccountCreateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The parameters used when creating a storage account. * @@ -23,13 +21,15 @@ class StorageAccountCreateParameters { * @member {string} [sku.name] Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku * name was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * @member {string} [sku.tier] Gets the sku tier. This is based on the SKU * name. Possible values include: 'Standard', 'Premium' * @member {string} [sku.resourceType] The type of the resource, usually it * is 'storageAccounts'. * @member {string} [sku.kind] Indicates the type of storage account. - * Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * @member {array} [sku.locations] The set of locations that the SKU is * available. This will be supported and registered Azure Geo Regions (e.g. * West US, East US, Southeast Asia, etc.). @@ -39,7 +39,8 @@ class StorageAccountCreateParameters { * @member {array} [sku.restrictions] The restrictions because of which SKU * cannot be used. This is empty if there are no restrictions. * @member {string} kind Required. Indicates the type of storage account. - * Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * @member {string} location Required. Gets or sets the location of the * resource. This will be one of the supported and registered Azure Geo * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a @@ -132,10 +133,12 @@ class StorageAccountCreateParameters { * @member {string} [accessTier] Required for storage accounts where kind = * BlobStorage. The access tier used for billing. Possible values include: * 'Hot', 'Cool' + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to - * storage service if sets to true. Default value: false . + * storage service if sets to true. * @member {boolean} [isHnsEnabled] Account HierarchicalNamespace enabled if - * sets to true. Default value: false . + * sets to true. */ constructor() { } @@ -167,7 +170,7 @@ class StorageAccountCreateParameters { serializedName: 'kind', type: { name: 'Enum', - allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage' ] + allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' ] } }, location: { @@ -231,10 +234,16 @@ class StorageAccountCreateParameters { allowedValues: [ 'Hot', 'Cool' ] } }, + enableAzureFilesAadIntegration: { + required: false, + serializedName: 'properties.azureFilesAadIntegration', + type: { + name: 'Boolean' + } + }, enableHttpsTrafficOnly: { required: false, serializedName: 'properties.supportsHttpsTrafficOnly', - defaultValue: false, type: { name: 'Boolean' } @@ -242,7 +251,6 @@ class StorageAccountCreateParameters { isHnsEnabled: { required: false, serializedName: 'properties.isHnsEnabled', - defaultValue: false, type: { name: 'Boolean' } diff --git a/lib/services/storageManagement2/lib/models/storageAccountListKeysResult.js b/lib/services/storageManagement2/lib/models/storageAccountListKeysResult.js index c7127c9441..b9945017c4 100644 --- a/lib/services/storageManagement2/lib/models/storageAccountListKeysResult.js +++ b/lib/services/storageManagement2/lib/models/storageAccountListKeysResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The response from the ListKeys operation. * diff --git a/lib/services/storageManagement2/lib/models/storageAccountUpdateParameters.js b/lib/services/storageManagement2/lib/models/storageAccountUpdateParameters.js index 8745c985b2..cb8a4ac56e 100644 --- a/lib/services/storageManagement2/lib/models/storageAccountUpdateParameters.js +++ b/lib/services/storageManagement2/lib/models/storageAccountUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The parameters that can be provided when updating the storage account * properties. @@ -21,18 +19,20 @@ class StorageAccountUpdateParameters { /** * Create a StorageAccountUpdateParameters. * @member {object} [sku] Gets or sets the SKU name. Note that the SKU name - * cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of - * those sku names be updated to any other value. + * cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can + * accounts of those sku names be updated to any other value. * @member {string} [sku.name] Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku * name was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * @member {string} [sku.tier] Gets the sku tier. This is based on the SKU * name. Possible values include: 'Standard', 'Premium' * @member {string} [sku.resourceType] The type of the resource, usually it * is 'storageAccounts'. * @member {string} [sku.kind] Indicates the type of storage account. - * Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * @member {array} [sku.locations] The set of locations that the SKU is * available. This will be supported and registered Azure Geo Regions (e.g. * West US, East US, Southeast Asia, etc.). @@ -114,8 +114,10 @@ class StorageAccountUpdateParameters { * @member {string} [accessTier] Required for storage accounts where kind = * BlobStorage. The access tier used for billing. Possible values include: * 'Hot', 'Cool' + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to - * storage service if sets to true. Default value: false . + * storage service if sets to true. * @member {object} [networkRuleSet] Network rule set * @member {string} [networkRuleSet.bypass] Specifies whether traffic is * bypassed for Logging/Metrics/AzureServices. Possible values are any @@ -130,7 +132,8 @@ class StorageAccountUpdateParameters { * include: 'Allow', 'Deny' * @member {string} [kind] Optional. Indicates the type of storage account. * Currently only StorageV2 value supported by server. Possible values - * include: 'Storage', 'StorageV2', 'BlobStorage' + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' */ constructor() { } @@ -203,10 +206,16 @@ class StorageAccountUpdateParameters { allowedValues: [ 'Hot', 'Cool' ] } }, + enableAzureFilesAadIntegration: { + required: false, + serializedName: 'properties.azureFilesAadIntegration', + type: { + name: 'Boolean' + } + }, enableHttpsTrafficOnly: { required: false, serializedName: 'properties.supportsHttpsTrafficOnly', - defaultValue: false, type: { name: 'Boolean' } @@ -224,7 +233,7 @@ class StorageAccountUpdateParameters { serializedName: 'kind', type: { name: 'Enum', - allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage' ] + allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' ] } } } diff --git a/lib/services/storageManagement2/lib/models/usage.js b/lib/services/storageManagement2/lib/models/usage.js index 35b36f46c6..1155505b8a 100644 --- a/lib/services/storageManagement2/lib/models/usage.js +++ b/lib/services/storageManagement2/lib/models/usage.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes Storage Resource Usage. * diff --git a/lib/services/storageManagement2/lib/operations/blobContainers.js b/lib/services/storageManagement2/lib/operations/blobContainers.js index ed994ad15f..0476f9c62f 100644 --- a/lib/services/storageManagement2/lib/operations/blobContainers.js +++ b/lib/services/storageManagement2/lib/operations/blobContainers.js @@ -53,6 +53,7 @@ function _list(resourceGroupName, accountName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -85,15 +86,6 @@ function _list(resourceGroupName, accountName, options, callback) { throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -117,7 +109,7 @@ function _list(resourceGroupName, accountName, options, callback) { requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -255,6 +247,7 @@ function _create(resourceGroupName, accountName, containerName, options, callbac } let publicAccess = (options && options.publicAccess !== undefined) ? options.publicAccess : undefined; let metadata = (options && options.metadata !== undefined) ? options.metadata : undefined; + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -300,15 +293,6 @@ function _create(resourceGroupName, accountName, containerName, options, callbac throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -356,7 +340,7 @@ function _create(resourceGroupName, accountName, containerName, options, callbac requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -507,6 +491,7 @@ function _update(resourceGroupName, accountName, containerName, options, callbac } let publicAccess = (options && options.publicAccess !== undefined) ? options.publicAccess : undefined; let metadata = (options && options.metadata !== undefined) ? options.metadata : undefined; + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -552,15 +537,6 @@ function _update(resourceGroupName, accountName, containerName, options, callbac throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -608,7 +584,7 @@ function _update(resourceGroupName, accountName, containerName, options, callbac requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -748,6 +724,7 @@ function _get(resourceGroupName, accountName, containerName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -793,15 +770,6 @@ function _get(resourceGroupName, accountName, containerName, options, callback) throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -826,7 +794,7 @@ function _get(resourceGroupName, accountName, containerName, options, callback) requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -951,6 +919,7 @@ function _deleteMethod(resourceGroupName, accountName, containerName, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -996,15 +965,6 @@ function _deleteMethod(resourceGroupName, accountName, containerName, options, c throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1029,7 +989,7 @@ function _deleteMethod(resourceGroupName, accountName, containerName, options, c requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1143,6 +1103,7 @@ function _setLegalHold(resourceGroupName, accountName, containerName, tags, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1188,15 +1149,6 @@ function _setLegalHold(resourceGroupName, accountName, containerName, tags, opti throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1238,7 +1190,7 @@ function _setLegalHold(resourceGroupName, accountName, containerName, tags, opti requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1383,6 +1335,7 @@ function _clearLegalHold(resourceGroupName, accountName, containerName, tags, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1428,15 +1381,6 @@ function _clearLegalHold(resourceGroupName, accountName, containerName, tags, op throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1478,7 +1422,7 @@ function _clearLegalHold(resourceGroupName, accountName, containerName, tags, op requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1629,6 +1573,7 @@ function _createOrUpdateImmutabilityPolicy(resourceGroupName, accountName, conta } let ifMatch = (options && options.ifMatch !== undefined) ? options.ifMatch : undefined; let immutabilityPolicyName = 'default'; + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1674,15 +1619,6 @@ function _createOrUpdateImmutabilityPolicy(resourceGroupName, accountName, conta throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1724,7 +1660,7 @@ function _createOrUpdateImmutabilityPolicy(resourceGroupName, accountName, conta requestUrl = requestUrl.replace('{immutabilityPolicyName}', encodeURIComponent(immutabilityPolicyName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1875,6 +1811,7 @@ function _getImmutabilityPolicy(resourceGroupName, accountName, containerName, o } let ifMatch = (options && options.ifMatch !== undefined) ? options.ifMatch : undefined; let immutabilityPolicyName = 'default'; + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1920,15 +1857,6 @@ function _getImmutabilityPolicy(resourceGroupName, accountName, containerName, o throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1957,7 +1885,7 @@ function _getImmutabilityPolicy(resourceGroupName, accountName, containerName, o requestUrl = requestUrl.replace('{immutabilityPolicyName}', encodeURIComponent(immutabilityPolicyName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2096,6 +2024,7 @@ function _deleteImmutabilityPolicy(resourceGroupName, accountName, containerName throw new Error('callback cannot be null.'); } let immutabilityPolicyName = 'default'; + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2141,15 +2070,6 @@ function _deleteImmutabilityPolicy(resourceGroupName, accountName, containerName throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2178,7 +2098,7 @@ function _deleteImmutabilityPolicy(resourceGroupName, accountName, containerName requestUrl = requestUrl.replace('{immutabilityPolicyName}', encodeURIComponent(immutabilityPolicyName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2314,6 +2234,7 @@ function _lockImmutabilityPolicy(resourceGroupName, accountName, containerName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2359,15 +2280,6 @@ function _lockImmutabilityPolicy(resourceGroupName, accountName, containerName, throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2395,7 +2307,7 @@ function _lockImmutabilityPolicy(resourceGroupName, accountName, containerName, requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2534,6 +2446,7 @@ function _extendImmutabilityPolicy(resourceGroupName, accountName, containerName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2579,15 +2492,6 @@ function _extendImmutabilityPolicy(resourceGroupName, accountName, containerName throw new Error('"containerName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2628,7 +2532,7 @@ function _extendImmutabilityPolicy(resourceGroupName, accountName, containerName requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/storageManagement2/lib/operations/index.d.ts b/lib/services/storageManagement2/lib/operations/index.d.ts index 765a314eec..b6a3c984b4 100644 --- a/lib/services/storageManagement2/lib/operations/index.d.ts +++ b/lib/services/storageManagement2/lib/operations/index.d.ts @@ -221,13 +221,15 @@ export interface StorageAccounts { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -309,6 +311,9 @@ export interface StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -350,13 +355,15 @@ export interface StorageAccounts { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -438,6 +445,9 @@ export interface StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -631,13 +641,14 @@ export interface StorageAccounts { * account. * * @param {object} [parameters.sku] Gets or sets the SKU name. Note that the - * SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts - * of those sku names be updated to any other value. + * SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor + * can accounts of those sku names be updated to any other value. * * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. @@ -698,6 +709,9 @@ export interface StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -720,7 +734,8 @@ export interface StorageAccounts { * * @param {string} [parameters.kind] Optional. Indicates the type of storage * account. Currently only StorageV2 value supported by server. Possible values - * include: 'Storage', 'StorageV2', 'BlobStorage' + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * * @param {object} [options] Optional Parameters. * @@ -757,13 +772,14 @@ export interface StorageAccounts { * account. * * @param {object} [parameters.sku] Gets or sets the SKU name. Note that the - * SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts - * of those sku names be updated to any other value. + * SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor + * can accounts of those sku names be updated to any other value. * * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. @@ -824,6 +840,9 @@ export interface StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -846,7 +865,8 @@ export interface StorageAccounts { * * @param {string} [parameters.kind] Optional. Indicates the type of storage * account. Currently only StorageV2 value supported by server. Possible values - * include: 'Storage', 'StorageV2', 'BlobStorage' + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * * @param {object} [options] Optional Parameters. * @@ -1446,210 +1466,6 @@ export interface StorageAccounts { listServiceSAS(resourceGroupName: string, accountName: string, parameters: models.ServiceSasParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * Gets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getManagementPoliciesWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {StorageAccountManagementPolicies} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {StorageAccountManagementPolicies} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountManagementPolicies} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getManagementPolicies(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getManagementPolicies(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - getManagementPolicies(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Sets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.policy] The Storage Account ManagementPolicies - * Rules, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateManagementPoliciesWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { policy? : any, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.policy] The Storage Account ManagementPolicies - * Rules, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {StorageAccountManagementPolicies} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {StorageAccountManagementPolicies} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountManagementPolicies} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateManagementPolicies(resourceGroupName: string, accountName: string, options?: { policy? : any, customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateManagementPolicies(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - createOrUpdateManagementPolicies(resourceGroupName: string, accountName: string, options: { policy? : any, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteManagementPoliciesWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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. - */ - deleteManagementPolicies(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteManagementPolicies(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - deleteManagementPolicies(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - /** * Asynchronously creates a new storage account with the specified parameters. * If an account is already created and a subsequent create request is issued @@ -1672,13 +1488,15 @@ export interface StorageAccounts { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -1760,6 +1578,9 @@ export interface StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -1801,13 +1622,15 @@ export interface StorageAccounts { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -1889,6 +1712,9 @@ export interface StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -1936,59 +1762,6 @@ export interface StorageAccounts { export interface Usages { - /** - * Gets the current usage count and the limit for the resources under 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>; - - /** - * Gets the current usage count and the limit for the resources under 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 {UsageListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {UsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsageListResult} for more information. - * - * {WebResource} [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; - - /** * Gets the current usage count and the limit for the resources of the location * under the subscription. @@ -3107,3 +2880,216 @@ export interface BlobContainers { extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, callback: ServiceCallback): void; extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * ManagementPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the StorageManagementClient. + */ +export interface ManagementPolicies { + + + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageAccountManagementPolicies} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageAccountManagementPolicies} [result] - The deserialized result object if an error did not occur. + * See {@link StorageAccountManagementPolicies} for more + * information. + * + * {WebResource} [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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.policy] The Storage Account ManagementPolicies + * Rules, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param {object} [options.customHeaders] Headers that 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, accountName: string, options?: { policy? : any, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.policy] The Storage Account ManagementPolicies + * Rules, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageAccountManagementPolicies} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageAccountManagementPolicies} [result] - The deserialized result object if an error did not occur. + * See {@link StorageAccountManagementPolicies} for more + * information. + * + * {WebResource} [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, accountName: string, options?: { policy? : any, customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, options: { policy? : any, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/storageManagement2/lib/operations/index.js b/lib/services/storageManagement2/lib/operations/index.js index 700065779f..f5f4b468a1 100644 --- a/lib/services/storageManagement2/lib/operations/index.js +++ b/lib/services/storageManagement2/lib/operations/index.js @@ -19,3 +19,4 @@ exports.Skus = require('./skus'); exports.StorageAccounts = require('./storageAccounts'); exports.Usages = require('./usages'); exports.BlobContainers = require('./blobContainers'); +exports.ManagementPolicies = require('./managementPolicies'); diff --git a/lib/services/storageManagement2/lib/operations/managementPolicies.js b/lib/services/storageManagement2/lib/operations/managementPolicies.js new file mode 100644 index 0000000000..875da78523 --- /dev/null +++ b/lib/services/storageManagement2/lib/operations/managementPolicies.js @@ -0,0 +1,862 @@ +/* + * 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; + +/** + * Gets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageAccountManagementPolicies} for more + * information. + * + * {object} [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, accountName, options, callback) { + /* jshint 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 apiVersion = '2018-03-01-preview'; + let managementPolicyName = 'default'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (accountName !== null && accountName !== undefined) { + if (accountName.length > 24) + { + throw new Error('"accountName" should satisfy the constraint - "MaxLength": 24'); + } + if (accountName.length < 3) + { + throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.length < 1) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{managementPolicyName}', encodeURIComponent(managementPolicyName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageAccountManagementPolicies']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Sets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.policy] The Storage Account ManagementPolicies + * Rules, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageAccountManagementPolicies} for more + * information. + * + * {object} [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, accountName, options, callback) { + /* jshint 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 policy = (options && options.policy !== undefined) ? options.policy : undefined; + let apiVersion = '2018-03-01-preview'; + let managementPolicyName = 'default'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (accountName !== null && accountName !== undefined) { + if (accountName.length > 24) + { + throw new Error('"accountName" should satisfy the constraint - "MaxLength": 24'); + } + if (accountName.length < 3) + { + throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.length < 1) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); + } + } + if (policy !== null && policy !== undefined && typeof policy !== 'object') { + throw new Error('policy must be of type object.'); + } + if (this.client.acceptLanguage !== null && this.client.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 properties; + if (policy !== null && policy !== undefined) { + properties = new client.models['ManagementPoliciesRulesSetParameter'](); + properties.policy = policy; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{managementPolicyName}', encodeURIComponent(managementPolicyName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (properties !== null && properties !== undefined) { + let requestModelMapper = new client.models['ManagementPoliciesRulesSetParameter']().mapper(); + requestModel = client.serialize(requestModelMapper, properties, 'properties'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(properties, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageAccountManagementPolicies']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, accountName, options, callback) { + /* jshint 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 apiVersion = '2018-03-01-preview'; + let managementPolicyName = 'default'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (accountName !== null && accountName !== undefined) { + if (accountName.length > 24) + { + throw new Error('"accountName" should satisfy the constraint - "MaxLength": 24'); + } + if (accountName.length < 3) + { + throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.length < 1) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{managementPolicyName}', encodeURIComponent(managementPolicyName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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); + }); +} + +/** Class representing a ManagementPolicies. */ +class ManagementPolicies { + /** + * Create a ManagementPolicies. + * @param {StorageManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + } + + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, accountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, accountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageAccountManagementPolicies} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageAccountManagementPolicies} for more + * information. + * + * {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, accountName, options, optionalCallback) { + 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, accountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, accountName, options, optionalCallback); + } + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.policy] The Storage Account ManagementPolicies + * Rules, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param {object} [options.customHeaders] Headers 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, accountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.policy] The Storage Account ManagementPolicies + * Rules, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageAccountManagementPolicies} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageAccountManagementPolicies} for more + * information. + * + * {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, accountName, options, optionalCallback) { + 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, accountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, accountName, options, optionalCallback); + } + } + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, accountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, accountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} accountName The name of the storage account within the + * specified resource group. Storage account names must be between 3 and 24 + * characters in length and use numbers and lower-case letters only. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, accountName, options, optionalCallback) { + 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, accountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, accountName, options, optionalCallback); + } + } + +} + +module.exports = ManagementPolicies; diff --git a/lib/services/storageManagement2/lib/operations/operations.js b/lib/services/storageManagement2/lib/operations/operations.js index b88d253ec5..5c94afdf5d 100644 --- a/lib/services/storageManagement2/lib/operations/operations.js +++ b/lib/services/storageManagement2/lib/operations/operations.js @@ -45,17 +45,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // 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.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -67,7 +59,7 @@ function _list(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Storage/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/storageManagement2/lib/operations/skus.js b/lib/services/storageManagement2/lib/operations/skus.js index 3bc96c9d5c..921e4e3c16 100644 --- a/lib/services/storageManagement2/lib/operations/skus.js +++ b/lib/services/storageManagement2/lib/operations/skus.js @@ -46,17 +46,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // 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.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -78,7 +70,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/storageManagement2/lib/operations/storageAccounts.js b/lib/services/storageManagement2/lib/operations/storageAccounts.js index b50f9a056c..176c3f95b9 100644 --- a/lib/services/storageManagement2/lib/operations/storageAccounts.js +++ b/lib/services/storageManagement2/lib/operations/storageAccounts.js @@ -48,17 +48,9 @@ function _checkNameAvailability(name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // 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.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -92,7 +84,7 @@ function _checkNameAvailability(name, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -211,13 +203,15 @@ function _checkNameAvailability(name, options, callback) { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -299,6 +293,9 @@ function _checkNameAvailability(name, options, callback) { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -412,6 +409,7 @@ function _deleteMethod(resourceGroupName, accountName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -444,15 +442,6 @@ function _deleteMethod(resourceGroupName, accountName, options, callback) { throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -476,7 +465,7 @@ function _deleteMethod(resourceGroupName, accountName, options, callback) { requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -581,6 +570,7 @@ function _getProperties(resourceGroupName, accountName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -613,15 +603,6 @@ function _getProperties(resourceGroupName, accountName, options, callback) { throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -645,7 +626,7 @@ function _getProperties(resourceGroupName, accountName, options, callback) { requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -749,13 +730,14 @@ function _getProperties(resourceGroupName, accountName, options, callback) { * account. * * @param {object} [parameters.sku] Gets or sets the SKU name. Note that the - * SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts - * of those sku names be updated to any other value. + * SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor + * can accounts of those sku names be updated to any other value. * * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. @@ -816,6 +798,9 @@ function _getProperties(resourceGroupName, accountName, options, callback) { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -838,7 +823,8 @@ function _getProperties(resourceGroupName, accountName, options, callback) { * * @param {string} [parameters.kind] Optional. Indicates the type of storage * account. Currently only StorageV2 value supported by server. Possible values - * include: 'Storage', 'StorageV2', 'BlobStorage' + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * * @param {object} [options] Optional Parameters. * @@ -872,6 +858,7 @@ function _update(resourceGroupName, accountName, parameters, options, callback) { parameters = {}; } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -907,15 +894,6 @@ function _update(resourceGroupName, accountName, parameters, options, callback) if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -939,7 +917,7 @@ function _update(resourceGroupName, accountName, parameters, options, callback) requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1068,17 +1046,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // 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.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1100,7 +1070,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1219,6 +1189,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1238,15 +1209,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1269,7 +1231,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1390,6 +1352,7 @@ function _listKeys(resourceGroupName, accountName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1422,15 +1385,6 @@ function _listKeys(resourceGroupName, accountName, options, callback) { throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1454,7 +1408,7 @@ function _listKeys(resourceGroupName, accountName, options, callback) { requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1578,6 +1532,7 @@ function _regenerateKey(resourceGroupName, accountName, keyName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1610,15 +1565,6 @@ function _regenerateKey(resourceGroupName, accountName, keyName, options, callba throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1650,7 +1596,7 @@ function _regenerateKey(resourceGroupName, accountName, keyName, options, callba requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1818,6 +1764,7 @@ function _listAccountSAS(resourceGroupName, accountName, parameters, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1853,15 +1800,6 @@ function _listAccountSAS(resourceGroupName, accountName, parameters, options, ca if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1885,7 +1823,7 @@ function _listAccountSAS(resourceGroupName, accountName, parameters, options, ca requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2077,6 +2015,7 @@ function _listServiceSAS(resourceGroupName, accountName, parameters, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2112,15 +2051,6 @@ function _listServiceSAS(resourceGroupName, accountName, parameters, options, ca if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2144,7 +2074,7 @@ function _listServiceSAS(resourceGroupName, accountName, parameters, options, ca requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2241,7 +2171,11 @@ function _listServiceSAS(resourceGroupName, accountName, parameters, options, ca } /** - * Gets the data policy rules associated with the specified storage account. + * Asynchronously creates a new storage account with the specified parameters. + * If an account is already created and a subsequent create request is issued + * with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is + * issued with the exact same set of properties, the request will succeed. * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. @@ -2250,6 +2184,113 @@ function _listServiceSAS(resourceGroupName, accountName, parameters, options, ca * specified resource group. Storage account names must be between 3 and 24 * characters in length and use numbers and lower-case letters only. * + * @param {object} parameters The parameters to provide for the created + * account. + * + * @param {object} parameters.sku Required. Gets or sets the sku name. + * + * @param {string} parameters.sku.name Gets or sets the sku name. Required for + * account creation; optional for update. Note that in older versions, sku name + * was called accountType. Possible values include: 'Standard_LRS', + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' + * + * @param {array} [parameters.sku.restrictions] The restrictions because of + * which SKU cannot be used. This is empty if there are no restrictions. + * + * @param {string} parameters.kind Required. Indicates the type of storage + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' + * + * @param {string} parameters.location Required. Gets or sets the location of + * the resource. This will be one of the supported and registered Azure Geo + * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + * resource cannot be changed once it is created, but if an identical geo + * region is specified on update, the request will succeed. + * + * @param {object} [parameters.tags] Gets or sets a list of key value pairs + * that describe the resource. These tags can be used for viewing and grouping + * this resource (across resource groups). A maximum of 15 tags can be provided + * for a resource. Each tag must have a key with a length no greater than 128 + * characters and a value with a length no greater than 256 characters. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {object} [parameters.customDomain] User domain assigned to the + * storage account. Name is the CNAME source. Only one custom domain is + * supported per storage account at this time. To clear the existing custom + * domain, use an empty string for the custom domain name property. + * + * @param {string} parameters.customDomain.name Gets or sets the custom domain + * name assigned to the storage account. Name is the CNAME source. + * + * @param {boolean} [parameters.customDomain.useSubDomain] Indicates whether + * indirect CName validation is enabled. Default value is false. This should + * only be set on updates. + * + * @param {object} [parameters.encryption] Provides the encryption settings on + * the account. If left unspecified the account encryption settings will remain + * the same. The default setting is unencrypted. + * + * @param {object} [parameters.encryption.services] List of services which + * support encryption. + * + * @param {object} [parameters.encryption.services.blob] The encryption + * function of the blob storage service. + * + * @param {object} [parameters.encryption.services.file] The encryption + * function of the file storage service. + * + * @param {boolean} [parameters.encryption.services.file.enabled] A boolean + * indicating whether or not the service encrypts the data as it is stored. + * + * @param {string} parameters.encryption.keySource The encryption keySource + * (provider). Possible values (case-insensitive): Microsoft.Storage, + * Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', + * 'Microsoft.Keyvault' + * + * @param {object} [parameters.encryption.keyVaultProperties] Properties + * provided by key vault. + * + * @param {string} [parameters.encryption.keyVaultProperties.keyName] The name + * of KeyVault key. + * + * @param {string} [parameters.encryption.keyVaultProperties.keyVersion] The + * version of KeyVault key. + * + * @param {string} [parameters.encryption.keyVaultProperties.keyVaultUri] The + * Uri of KeyVault. + * + * @param {object} [parameters.networkRuleSet] Network rule set + * + * @param {string} [parameters.networkRuleSet.bypass] Specifies whether traffic + * is bypassed for Logging/Metrics/AzureServices. Possible values are any + * combination of Logging|Metrics|AzureServices (For example, "Logging, + * Metrics"), or None to bypass none of those traffics. Possible values + * include: 'None', 'Logging', 'Metrics', 'AzureServices' + * + * @param {array} [parameters.networkRuleSet.virtualNetworkRules] Sets the + * virtual network rules + * + * @param {array} [parameters.networkRuleSet.ipRules] Sets the IP ACL rules + * + * @param {string} parameters.networkRuleSet.defaultAction Specifies the + * default action of allow or deny when no other rules match. Possible values + * include: 'Allow', 'Deny' + * + * @param {string} [parameters.accessTier] Required for storage accounts where + * kind = BlobStorage. The access tier used for billing. Possible values + * include: 'Hot', 'Cool' + * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * + * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic + * only to storage service if sets to true. + * + * @param {boolean} [parameters.isHnsEnabled] Account HierarchicalNamespace + * enabled if sets to true. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2262,14 +2303,13 @@ function _listServiceSAS(resourceGroupName, accountName, parameters, options, ca * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountManagementPolicies} for more - * information. + * See {@link StorageAccount} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getManagementPolicies(resourceGroupName, accountName, options, callback) { +function _beginCreate(resourceGroupName, accountName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2279,7 +2319,11 @@ function _getManagementPolicies(resourceGroupName, accountName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let managementPolicyName = 'default'; + if (parameters === null || parameters === undefined) + { + parameters = {}; + } + let apiVersion = '2018-07-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2312,14 +2356,8 @@ function _getManagementPolicies(resourceGroupName, accountName, options, callbac throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); } } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } + 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.'); @@ -2339,20 +2377,19 @@ function _getManagementPolicies(resourceGroupName, accountName, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{managementPolicyName}', encodeURIComponent(managementPolicyName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2370,14 +2407,28 @@ function _getManagementPolicies(resourceGroupName, accountName, options, callbac } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['StorageAccountCreateParameters']().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) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2412,7 +2463,7 @@ function _getManagementPolicies(resourceGroupName, accountName, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageAccountManagementPolicies']().mapper(); + let resultMapper = new client.models['StorageAccount']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2427,722 +2478,26 @@ function _getManagementPolicies(resourceGroupName, accountName, options, callbac }); } -/** - * Sets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.policy] The Storage Account ManagementPolicies - * Rules, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountManagementPolicies} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdateManagementPolicies(resourceGroupName, accountName, options, callback) { - /* jshint 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 policy = (options && options.policy !== undefined) ? options.policy : undefined; - let managementPolicyName = 'default'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (accountName !== null && accountName !== undefined) { - if (accountName.length > 24) - { - throw new Error('"accountName" should satisfy the constraint - "MaxLength": 24'); - } - if (accountName.length < 3) - { - throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); - } - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { - if (this.client.subscriptionId.length < 1) - { - throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); - } - } - if (policy !== null && policy !== undefined && typeof policy !== 'object') { - throw new Error('policy must be of type object.'); - } - if (this.client.acceptLanguage !== null && this.client.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 properties; - if (policy !== null && policy !== undefined) { - properties = new client.models['ManagementPoliciesRulesSetParameter'](); - properties.policy = policy; - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{managementPolicyName}', encodeURIComponent(managementPolicyName)); - let queryParameters = []; - queryParameters.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 (properties !== null && properties !== undefined) { - let requestModelMapper = new client.models['ManagementPoliciesRulesSetParameter']().mapper(); - requestModel = client.serialize(requestModelMapper, properties, 'properties'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(properties, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageAccountManagementPolicies']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * 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 _deleteManagementPolicies(resourceGroupName, accountName, options, callback) { - /* jshint 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 managementPolicyName = 'default'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (accountName !== null && accountName !== undefined) { - if (accountName.length > 24) - { - throw new Error('"accountName" should satisfy the constraint - "MaxLength": 24'); - } - if (accountName.length < 3) - { - throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); - } - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { - if (this.client.subscriptionId.length < 1) - { - throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); - } - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{managementPolicyName}', encodeURIComponent(managementPolicyName)); - let queryParameters = []; - queryParameters.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); - }); -} - -/** - * Asynchronously creates a new storage account with the specified parameters. - * If an account is already created and a subsequent create request is issued - * with different properties, the account properties will be updated. If an - * account is already created and a subsequent create or update request is - * issued with the exact same set of properties, the request will succeed. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} parameters The parameters to provide for the created - * account. - * - * @param {object} parameters.sku Required. Gets or sets the sku name. - * - * @param {string} parameters.sku.name Gets or sets the sku name. Required for - * account creation; optional for update. Note that in older versions, sku name - * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - * - * @param {array} [parameters.sku.restrictions] The restrictions because of - * which SKU cannot be used. This is empty if there are no restrictions. - * - * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' - * - * @param {string} parameters.location Required. Gets or sets the location of - * the resource. This will be one of the supported and registered Azure Geo - * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - * resource cannot be changed once it is created, but if an identical geo - * region is specified on update, the request will succeed. - * - * @param {object} [parameters.tags] Gets or sets a list of key value pairs - * that describe the resource. These tags can be used for viewing and grouping - * this resource (across resource groups). A maximum of 15 tags can be provided - * for a resource. Each tag must have a key with a length no greater than 128 - * characters and a value with a length no greater than 256 characters. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {object} [parameters.customDomain] User domain assigned to the - * storage account. Name is the CNAME source. Only one custom domain is - * supported per storage account at this time. To clear the existing custom - * domain, use an empty string for the custom domain name property. - * - * @param {string} parameters.customDomain.name Gets or sets the custom domain - * name assigned to the storage account. Name is the CNAME source. - * - * @param {boolean} [parameters.customDomain.useSubDomain] Indicates whether - * indirect CName validation is enabled. Default value is false. This should - * only be set on updates. - * - * @param {object} [parameters.encryption] Provides the encryption settings on - * the account. If left unspecified the account encryption settings will remain - * the same. The default setting is unencrypted. - * - * @param {object} [parameters.encryption.services] List of services which - * support encryption. - * - * @param {object} [parameters.encryption.services.blob] The encryption - * function of the blob storage service. - * - * @param {object} [parameters.encryption.services.file] The encryption - * function of the file storage service. - * - * @param {boolean} [parameters.encryption.services.file.enabled] A boolean - * indicating whether or not the service encrypts the data as it is stored. - * - * @param {string} parameters.encryption.keySource The encryption keySource - * (provider). Possible values (case-insensitive): Microsoft.Storage, - * Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', - * 'Microsoft.Keyvault' - * - * @param {object} [parameters.encryption.keyVaultProperties] Properties - * provided by key vault. - * - * @param {string} [parameters.encryption.keyVaultProperties.keyName] The name - * of KeyVault key. - * - * @param {string} [parameters.encryption.keyVaultProperties.keyVersion] The - * version of KeyVault key. - * - * @param {string} [parameters.encryption.keyVaultProperties.keyVaultUri] The - * Uri of KeyVault. - * - * @param {object} [parameters.networkRuleSet] Network rule set - * - * @param {string} [parameters.networkRuleSet.bypass] Specifies whether traffic - * is bypassed for Logging/Metrics/AzureServices. Possible values are any - * combination of Logging|Metrics|AzureServices (For example, "Logging, - * Metrics"), or None to bypass none of those traffics. Possible values - * include: 'None', 'Logging', 'Metrics', 'AzureServices' - * - * @param {array} [parameters.networkRuleSet.virtualNetworkRules] Sets the - * virtual network rules - * - * @param {array} [parameters.networkRuleSet.ipRules] Sets the IP ACL rules - * - * @param {string} parameters.networkRuleSet.defaultAction Specifies the - * default action of allow or deny when no other rules match. Possible values - * include: 'Allow', 'Deny' - * - * @param {string} [parameters.accessTier] Required for storage accounts where - * kind = BlobStorage. The access tier used for billing. Possible values - * include: 'Hot', 'Cool' - * - * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic - * only to storage service if sets to true. - * - * @param {boolean} [parameters.isHnsEnabled] Account HierarchicalNamespace - * enabled if sets to 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. - * See {@link StorageAccount} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _beginCreate(resourceGroupName, accountName, 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.'); - } - if (parameters === null || parameters === undefined) - { - parameters = {}; - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (accountName !== null && accountName !== undefined) { - if (accountName.length > 24) - { - throw new Error('"accountName" should satisfy the constraint - "MaxLength": 24'); - } - if (accountName.length < 3) - { - throw new Error('"accountName" should satisfy the constraint - "MinLength": 3'); - } - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { - if (this.client.subscriptionId.length < 1) - { - throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); - } - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['StorageAccountCreateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageAccount']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred 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 StorageAccounts. */ -class StorageAccounts { - /** - * Create a StorageAccounts. - * @param {StorageManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._checkNameAvailability = _checkNameAvailability; - this._create = _create; - this._deleteMethod = _deleteMethod; - this._getProperties = _getProperties; - this._update = _update; - this._list = _list; - this._listByResourceGroup = _listByResourceGroup; - this._listKeys = _listKeys; - this._regenerateKey = _regenerateKey; - this._listAccountSAS = _listAccountSAS; - this._listServiceSAS = _listServiceSAS; - this._getManagementPolicies = _getManagementPolicies; - this._createOrUpdateManagementPolicies = _createOrUpdateManagementPolicies; - this._deleteManagementPolicies = _deleteManagementPolicies; - this._beginCreate = _beginCreate; +/** Class representing a StorageAccounts. */ +class StorageAccounts { + /** + * Create a StorageAccounts. + * @param {StorageManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._checkNameAvailability = _checkNameAvailability; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._getProperties = _getProperties; + this._update = _update; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._listKeys = _listKeys; + this._regenerateKey = _regenerateKey; + this._listAccountSAS = _listAccountSAS; + this._listServiceSAS = _listServiceSAS; + this._beginCreate = _beginCreate; } /** @@ -3250,13 +2605,15 @@ class StorageAccounts { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -3338,6 +2695,9 @@ class StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -3391,13 +2751,15 @@ class StorageAccounts { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -3479,6 +2841,9 @@ class StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -3741,13 +3106,14 @@ class StorageAccounts { * account. * * @param {object} [parameters.sku] Gets or sets the SKU name. Note that the - * SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts - * of those sku names be updated to any other value. + * SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor + * can accounts of those sku names be updated to any other value. * * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. @@ -3808,6 +3174,9 @@ class StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -3830,7 +3199,8 @@ class StorageAccounts { * * @param {string} [parameters.kind] Optional. Indicates the type of storage * account. Currently only StorageV2 value supported by server. Possible values - * include: 'Storage', 'StorageV2', 'BlobStorage' + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * * @param {object} [options] Optional Parameters. * @@ -3879,13 +3249,14 @@ class StorageAccounts { * account. * * @param {object} [parameters.sku] Gets or sets the SKU name. Note that the - * SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts - * of those sku names be updated to any other value. + * SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor + * can accounts of those sku names be updated to any other value. * * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. @@ -3946,6 +3317,9 @@ class StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -3968,7 +3342,8 @@ class StorageAccounts { * * @param {string} [parameters.kind] Optional. Indicates the type of storage * account. Currently only StorageV2 value supported by server. Possible values - * include: 'Storage', 'StorageV2', 'BlobStorage' + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * * @param {object} [options] Optional Parameters. * @@ -4745,291 +4120,6 @@ class StorageAccounts { } } - /** - * Gets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getManagementPoliciesWithHttpOperationResponse(resourceGroupName, accountName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getManagementPolicies(resourceGroupName, accountName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {StorageAccountManagementPolicies} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountManagementPolicies} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getManagementPolicies(resourceGroupName, accountName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getManagementPolicies(resourceGroupName, accountName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getManagementPolicies(resourceGroupName, accountName, options, optionalCallback); - } - } - - /** - * Sets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.policy] The Storage Account ManagementPolicies - * Rules, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateManagementPoliciesWithHttpOperationResponse(resourceGroupName, accountName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateManagementPolicies(resourceGroupName, accountName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.policy] The Storage Account ManagementPolicies - * Rules, in JSON format. See more details in: - * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {StorageAccountManagementPolicies} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountManagementPolicies} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateManagementPolicies(resourceGroupName, accountName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdateManagementPolicies(resourceGroupName, accountName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateManagementPolicies(resourceGroupName, accountName, options, optionalCallback); - } - } - - /** - * Deletes the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteManagementPoliciesWithHttpOperationResponse(resourceGroupName, accountName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteManagementPolicies(resourceGroupName, accountName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the data policy rules associated with the specified storage account. - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} accountName The name of the storage account within the - * specified resource group. Storage account names must be between 3 and 24 - * characters in length and use numbers and lower-case letters only. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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. - */ - deleteManagementPolicies(resourceGroupName, accountName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteManagementPolicies(resourceGroupName, accountName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteManagementPolicies(resourceGroupName, accountName, options, optionalCallback); - } - } - /** * Asynchronously creates a new storage account with the specified parameters. * If an account is already created and a subsequent create request is issued @@ -5052,13 +4142,15 @@ class StorageAccounts { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -5140,6 +4232,9 @@ class StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * @@ -5193,13 +4288,15 @@ class StorageAccounts { * @param {string} parameters.sku.name Gets or sets the sku name. Required for * account creation; optional for update. Note that in older versions, sku name * was called accountType. Possible values include: 'Standard_LRS', - * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS' * * @param {array} [parameters.sku.restrictions] The restrictions because of * which SKU cannot be used. This is empty if there are no restrictions. * * @param {string} parameters.kind Required. Indicates the type of storage - * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + * account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' * * @param {string} parameters.location Required. Gets or sets the location of * the resource. This will be one of the supported and registered Azure Geo @@ -5281,6 +4378,9 @@ class StorageAccounts { * kind = BlobStorage. The access tier used for billing. Possible values * include: 'Hot', 'Cool' * + * @param {boolean} [parameters.enableAzureFilesAadIntegration] Enables Azure + * Files AAD Integration for SMB if sets to true. + * * @param {boolean} [parameters.enableHttpsTrafficOnly] Allows https traffic * only to storage service if sets to true. * diff --git a/lib/services/storageManagement2/lib/operations/usages.js b/lib/services/storageManagement2/lib/operations/usages.js index 8d3e0ea7d0..ff9e10f11f 100644 --- a/lib/services/storageManagement2/lib/operations/usages.js +++ b/lib/services/storageManagement2/lib/operations/usages.js @@ -14,152 +14,6 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; -/** - * Gets the current usage count and the limit for the resources under 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 UsageListResult} for more information. - * - * {object} [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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { - if (this.client.subscriptionId.length < 1) - { - throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1'); - } - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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.Storage/usages'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['UsageListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - /** * Gets the current usage count and the limit for the resources of the location * under the subscription. @@ -194,17 +48,9 @@ function _listByLocation(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-07-01'; // 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.apiVersion !== null && this.client.apiVersion !== undefined) { - if (this.client.apiVersion.length < 1) - { - throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1'); - } - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -230,7 +76,7 @@ function _listByLocation(location, options, callback) { requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -320,90 +166,9 @@ class Usages { */ constructor(client) { this.client = client; - this._list = _list; this._listByLocation = _listByLocation; } - /** - * Gets the current usage count and the limit for the resources under 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; - }); - }); - } - - /** - * Gets the current usage count and the limit for the resources under 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 {UsageListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link UsageListResult} for more information. - * - * {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); - } - } - /** * Gets the current usage count and the limit for the resources of the location * under the subscription. diff --git a/lib/services/storageManagement2/lib/storageManagementClient.d.ts b/lib/services/storageManagement2/lib/storageManagementClient.d.ts index 3d12a541e2..d8ea060b72 100644 --- a/lib/services/storageManagement2/lib/storageManagementClient.d.ts +++ b/lib/services/storageManagement2/lib/storageManagementClient.d.ts @@ -47,8 +47,6 @@ export default class StorageManagementClient extends AzureServiceClient { subscriptionId: string; - apiVersion: string; - acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -61,6 +59,7 @@ export default class StorageManagementClient extends AzureServiceClient { storageAccounts: operations.StorageAccounts; usages: operations.Usages; blobContainers: operations.BlobContainers; + managementPolicies: operations.ManagementPolicies; } export { StorageManagementClient, models as StorageManagementModels }; diff --git a/lib/services/storageManagement2/lib/storageManagementClient.js b/lib/services/storageManagement2/lib/storageManagementClient.js index 9a3fda0a16..9529d5b9c2 100644 --- a/lib/services/storageManagement2/lib/storageManagementClient.js +++ b/lib/services/storageManagement2/lib/storageManagementClient.js @@ -50,7 +50,6 @@ class StorageManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2018-03-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -77,6 +76,7 @@ class StorageManagementClient extends ServiceClient { this.storageAccounts = new operations.StorageAccounts(this); this.usages = new operations.Usages(this); this.blobContainers = new operations.BlobContainers(this); + this.managementPolicies = new operations.ManagementPolicies(this); this.models = models; msRest.addSerializationMixin(this); } From acc6c1f7b48a9fd79f03ab292133396051cf3ce7 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 27 Sep 2018 20:16:03 +0000 Subject: [PATCH 5/5] Generated from 74a39e5f5ad66e565bf4e00d6a659f73903fc477 Merge branch 'master' into daschult/storage --- .../applicationInsightsManagementClient.d.ts | 12 +- .../applicationInsightsManagementClient.js | 12 +- .../lib/models/annotationError.js | 2 - .../lib/models/annotationsListResult.js | 60 + ...plicationInsightsComponentAnalyticsItem.js | 2 - ...ationInsightsComponentAvailableFeatures.js | 2 - ...icationInsightsComponentBillingFeatures.js | 2 - .../applicationInsightsComponentFeature.js | 2 - .../lib/models/componentPurgeBody.js | 2 - .../applicationinsights/lib/models/index.d.ts | 42 +- .../applicationinsights/lib/models/index.js | 4 +- .../lib/models/operation.js | 2 - .../lib/models/workItemConfigurationError.js | 2 - .../workItemConfigurationsListResult.js | 60 + .../lib/models/workbookError.js | 2 - .../lib/models/workbooksListResult.js | 60 + .../lib/operations/analyticsItems.js | 1280 + .../lib/operations/annotations.js | 26 +- .../lib/operations/favorites.js | 1279 +- .../lib/operations/index.d.ts | 73 +- .../lib/operations/index.js | 6 +- .../lib/operations/workItemConfigurations.js | 28 +- .../lib/operations/workbooks.js | 1517 + lib/services/applicationinsights/package.json | 4 +- .../authorizationManagement/LICENSE.txt | 42 +- .../authorizationManagement/README.md | 80 +- .../lib/authorizationManagementClient.d.ts | 7 +- .../lib/authorizationManagementClient.js | 7 +- .../lib/models/denyAssignment.js | 165 + .../lib/models/denyAssignmentFilter.js | 72 + .../lib/models/denyAssignmentListResult.js | 68 + .../lib/models/denyAssignmentPermission.js | 108 + .../lib/models/index.d.ts | 121 +- .../lib/models/index.js | 5 + .../lib/models/principal.js | 68 + .../lib/models/providerOperationsMetadata.js | 2 - .../lib/models/resourceType.js | 2 - .../models/roleAssignmentCreateParameters.js | 10 +- .../lib/models/roleDefinition.js | 2 - .../lib/operations/denyAssignments.js | 2446 + .../lib/operations/index.d.ts | 725 +- .../lib/operations/index.js | 1 + .../lib/operations/roleAssignments.js | 24 +- .../authorizationManagement/package.json | 11 +- lib/services/computeManagement2/LICENSE.txt | 42 +- .../lib/computeManagementClient.d.ts | 11 +- .../lib/computeManagementClient.js | 11 +- .../lib/models/accessUri.js | 2 +- .../lib/models/additionalCapabilities.js | 57 + .../computeManagement2/lib/models/apiError.js | 2 - .../lib/models/automaticOSUpgradePolicy.js | 63 + .../lib/models/availabilitySet.js | 5 +- .../lib/models/availabilitySetListResult.js | 12 +- .../lib/models/availabilitySetUpdate.js | 10 +- .../lib/models/bootDiagnostics.js | 5 +- .../lib/models/bootDiagnosticsInstanceView.js | 22 + .../containerServiceDiagnosticsProfile.js | 2 - .../models/containerServiceLinuxProfile.js | 2 - .../containerServiceSshConfiguration.js | 2 - .../lib/models/creationData.js | 4 +- .../computeManagement2/lib/models/dataDisk.js | 9 +- .../lib/models/diagnosticsProfile.js | 7 +- .../lib/models/diffDiskSettings.js | 55 + .../lib/models/disallowed.js | 59 + .../computeManagement2/lib/models/disk.js | 24 +- .../lib/models/diskEncryptionSettings.js | 2 - .../lib/models/diskInstanceView.js | 2 - .../computeManagement2/lib/models/diskSku.js | 5 +- .../lib/models/diskUpdate.js | 75 +- .../lib/models/encryptionSettings.js | 2 - .../computeManagement2/lib/models/gallery.js | 126 + .../galleryArtifactPublishingProfileBase.js | 72 + .../lib/models/galleryArtifactSource.js | 54 + .../lib/models/galleryDataDiskImage.js | 77 + .../lib/models/galleryDiskImage.js | 66 + .../lib/models/galleryIdentifier.js | 54 + .../lib/models/galleryImage.js | 228 + .../lib/models/galleryImageIdentifier.js | 69 + .../lib/models/galleryImageList.js | 69 + .../lib/models/galleryImageVersion.js | 156 + .../lib/models/galleryImageVersionList.js | 69 + .../galleryImageVersionPublishingProfile.js | 112 + .../galleryImageVersionStorageProfile.js | 71 + .../lib/models/galleryList.js | 68 + .../lib/models/galleryOSDiskImage.js | 65 + .../computeManagement2/lib/models/image.js | 6 +- .../lib/models/imageDataDisk.js | 7 +- .../lib/models/imageDiskReference.js | 2 +- .../lib/models/imageOSDisk.js | 7 +- .../lib/models/imagePurchasePlan.js | 69 + .../lib/models/imageStorageProfile.js | 7 +- .../lib/models/imageUpdate.js | 10 +- .../computeManagement2/lib/models/index.d.ts | 2139 +- .../computeManagement2/lib/models/index.js | 49 +- .../lib/models/keyVaultAndKeyReference.js | 2 - .../lib/models/keyVaultAndSecretReference.js | 2 - .../lib/models/keyVaultKeyReference.js | 2 - .../lib/models/keyVaultSecretReference.js | 2 - .../lib/models/linuxConfiguration.js | 14 +- .../lib/models/logAnalyticsOperationResult.js | 47 +- .../lib/models/managedArtifact.js | 52 + .../lib/models/managedDiskParameters.js | 5 +- .../lib/models/networkProfile.js | 2 - .../computeManagement2/lib/models/oSDisk.js | 21 +- .../lib/models/oSProfile.js | 17 +- .../models/recommendedMachineConfiguration.js | 67 + .../lib/models/regionalReplicationStatus.js | 82 + .../lib/models/replicationStatus.js | 73 + .../lib/models/resourceRange.js | 60 + .../lib/models/resourceSku.js | 2 - .../lib/models/resourceSkuRestrictions.js | 2 - .../lib/models/rollbackStatusInfo.js | 85 + .../lib/models/runCommandInput.js | 2 - .../lib/models/runCommandResult.js | 66 +- .../computeManagement2/lib/models/snapshot.js | 2 +- .../lib/models/snapshotUpdate.js | 55 +- .../lib/models/sshConfiguration.js | 2 - .../lib/models/storageProfile.js | 15 +- .../lib/models/targetRegion.js | 61 + .../upgradeOperationHistoricalStatusInfo.js | 143 + ...OperationHistoricalStatusInfoProperties.js | 155 + .../models/upgradeOperationHistoryStatus.js | 74 + .../lib/models/upgradePolicy.js | 21 +- .../computeManagement2/lib/models/usage.js | 2 - .../lib/models/vaultSecretGroup.js | 2 - .../lib/models/virtualMachine.js | 71 +- .../models/virtualMachineAgentInstanceView.js | 2 - .../lib/models/virtualMachineCaptureResult.js | 44 +- ...tualMachineExtensionHandlerInstanceView.js | 2 - .../virtualMachineExtensionInstanceView.js | 2 - .../virtualMachineExtensionsListResult.js | 2 - .../lib/models/virtualMachineHealthStatus.js | 2 - .../lib/models/virtualMachineIdentity.js | 21 +- ...hineIdentityUserAssignedIdentitiesValue.js | 61 + .../lib/models/virtualMachineInstanceView.js | 18 +- .../lib/models/virtualMachineScaleSet.js | 67 +- .../models/virtualMachineScaleSetDataDisk.js | 9 +- .../virtualMachineScaleSetExtensionProfile.js | 2 - .../virtualMachineScaleSetIPConfiguration.js | 23 + .../models/virtualMachineScaleSetIdentity.js | 21 +- ...eSetIdentityUserAssignedIdentitiesValue.js | 61 + .../virtualMachineScaleSetInstanceView.js | 2 - ...hineScaleSetInstanceViewStatusesSummary.js | 2 - .../lib/models/virtualMachineScaleSetIpTag.js | 61 + ...tualMachineScaleSetListOSUpgradeHistory.js | 69 + ...ualMachineScaleSetManagedDiskParameters.js | 5 +- .../virtualMachineScaleSetNetworkProfile.js | 2 - .../models/virtualMachineScaleSetOSDisk.js | 31 +- .../models/virtualMachineScaleSetOSProfile.js | 7 +- ...ineScaleSetPublicIPAddressConfiguration.js | 30 +- .../lib/models/virtualMachineScaleSetSku.js | 2 - .../virtualMachineScaleSetStorageProfile.js | 18 +- .../models/virtualMachineScaleSetUpdate.js | 44 +- ...ualMachineScaleSetUpdateIPConfiguration.js | 17 + ...tualMachineScaleSetUpdateNetworkProfile.js | 2 - .../virtualMachineScaleSetUpdateOSDisk.js | 18 +- .../virtualMachineScaleSetUpdateOSProfile.js | 7 +- ...leSetUpdatePublicIPAddressConfiguration.js | 2 - ...tualMachineScaleSetUpdateStorageProfile.js | 12 +- .../virtualMachineScaleSetUpdateVMProfile.js | 24 +- .../lib/models/virtualMachineScaleSetVM.js | 113 +- ...rtualMachineScaleSetVMExtensionsSummary.js | 2 - .../virtualMachineScaleSetVMInstanceView.js | 18 +- .../models/virtualMachineScaleSetVMProfile.js | 57 +- .../lib/models/virtualMachineUpdate.js | 73 +- .../lib/models/winRMConfiguration.js | 2 - .../lib/models/windowsConfiguration.js | 2 - .../lib/operations/availabilitySets.js | 836 +- .../lib/operations/disks.js | 258 +- .../lib/operations/galleries.js | 2009 + .../lib/operations/galleryImageVersions.js | 1882 + .../lib/operations/galleryImages.js | 1984 + .../lib/operations/images.js | 139 +- .../lib/operations/index.d.ts | 11374 +- .../lib/operations/index.js | 5 +- .../lib/operations/logAnalytics.js | 4 +- .../lib/operations/operations.js | 2 +- .../lib/operations/snapshots.js | 150 +- .../lib/operations/usageOperations.js | 2 +- .../virtualMachineExtensionImages.js | 6 +- .../operations/virtualMachineExtensions.js | 314 +- .../lib/operations/virtualMachineImages.js | 10 +- .../operations/virtualMachineRunCommands.js | 4 +- .../virtualMachineScaleSetExtensions.js | 63 +- .../virtualMachineScaleSetRollingUpgrades.js | 480 +- .../operations/virtualMachineScaleSetVMs.js | 1207 +- .../lib/operations/virtualMachineScaleSets.js | 1903 +- .../lib/operations/virtualMachineSizes.js | 11 +- .../lib/operations/virtualMachines.js | 1471 +- lib/services/computeManagement2/package.json | 11 +- lib/services/frontdoorManagement/LICENSE.txt | 21 + lib/services/frontdoorManagement/README.md | 40 + .../lib/frontdoorManagementClient.d.ts | 211 + .../lib/frontdoorManagementClient.js | 608 + .../lib/models/azureAsyncOperationResult.js | 75 + .../models/azureManagedOverrideRuleGroup.js | 62 + .../lib/models/azureManagedRuleSet.js | 92 + .../frontdoorManagement/lib/models/backend.js | 125 + .../lib/models/backendPool.js | 119 + .../lib/models/backendPoolListResult.js | 70 + .../lib/models/backendPoolUpdateParameters.js | 82 + .../lib/models/cacheConfiguration.js | 64 + .../lib/models/checkNameAvailabilityInput.js | 63 + .../lib/models/checkNameAvailabilityOutput.js | 73 + .../lib/models/customHttpsConfiguration.js | 100 + .../lib/models/customRule.js | 141 + .../lib/models/customRules.js | 60 + .../lib/models/errorDetails.js | 67 + .../lib/models/errorModel.js | 91 + .../lib/models/errorResponse.js | 64 + .../lib/models/frontDoor.js | 225 + .../lib/models/frontDoorListResult.js | 70 + .../lib/models/frontDoorUpdateParameters.js | 146 + .../lib/models/frontendEndpoint.js | 175 + .../frontendEndpointUpdateParameters.js | 83 + ...ametersWebApplicationFirewallPolicyLink.js | 52 + .../lib/models/frontendEndpointsListResult.js | 70 + .../models/healthProbeSettingsListResult.js | 71 + .../lib/models/healthProbeSettingsModel.js | 107 + .../healthProbeSettingsUpdateParameters.js | 70 + .../frontdoorManagement/lib/models/index.d.ts | 982 + .../frontdoorManagement/lib/models/index.js | 69 + ...eyVaultCertificateSourceParametersVault.js | 52 + .../models/loadBalancingSettingsListResult.js | 71 + .../lib/models/loadBalancingSettingsModel.js | 108 + .../loadBalancingSettingsUpdateParameters.js | 71 + .../lib/models/managedRuleSet.js | 74 + .../lib/models/managedRuleSets.js | 65 + .../lib/models/matchCondition1.js | 98 + .../lib/models/policySettings.js | 63 + .../lib/models/purgeParameters.js | 60 + .../lib/models/resource.js | 98 + .../lib/models/routingRule.js | 186 + .../lib/models/routingRuleListResult.js | 70 + .../lib/models/routingRuleUpdateParameters.js | 148 + .../lib/models/subResource.js | 56 + .../lib/models/tagsObject.js | 59 + .../lib/models/validateCustomDomainInput.js | 53 + .../lib/models/validateCustomDomainOutput.js | 73 + .../models/webApplicationFirewallPolicy1.js | 158 + .../webApplicationFirewallPolicyListResult.js | 71 + .../lib/operations/backendPools.js | 1900 + .../lib/operations/endpoints.js | 495 + .../lib/operations/frontDoors.js | 2566 + .../lib/operations/frontendEndpoints.js | 2999 + .../lib/operations/healthProbeSettings.js | 1898 + .../lib/operations/index.d.ts | 4711 + .../lib/operations/index.js | 24 + .../lib/operations/loadBalancingSettings.js | 1910 + .../lib/operations/policies.js | 1438 + .../lib/operations/routingRules.js | 2068 + lib/services/frontdoorManagement/package.json | 25 + lib/services/keyvault/LICENSE.txt | 21 + lib/services/keyvault/lib/keyVaultClient.d.ts | 7972 + lib/services/keyvault/lib/keyVaultClient.js | 25998 +++ lib/services/keyvault/lib/models/action.js | 54 + .../lib/models/administratorDetails.js | 76 + .../keyvault/lib/models/attributes.js | 86 + .../lib/models/backupCertificateResult.js | 54 + .../keyvault/lib/models/backupKeyResult.js | 53 + .../keyvault/lib/models/backupSecretResult.js | 53 + .../lib/models/backupStorageResult.js | 54 + .../lib/models/certificateAttributes.js | 101 + .../keyvault/lib/models/certificateBundle.js | 198 + .../lib/models/certificateCreateParameters.js | 151 + .../lib/models/certificateImportParameters.js | 170 + .../lib/models/certificateIssuerItem.js | 60 + .../lib/models/certificateIssuerListResult.js | 70 + .../models/certificateIssuerSetParameters.js | 90 + .../certificateIssuerUpdateParameters.js | 90 + .../keyvault/lib/models/certificateItem.js | 92 + .../lib/models/certificateListResult.js | 69 + .../lib/models/certificateMergeParameters.js | 93 + .../lib/models/certificateOperation.js | 135 + .../certificateOperationUpdateParameter.js | 53 + .../keyvault/lib/models/certificatePolicy.js | 161 + .../models/certificateRestoreParameters.js | 53 + .../lib/models/certificateUpdateParameters.js | 151 + lib/services/keyvault/lib/models/contact.js | 68 + lib/services/keyvault/lib/models/contacts.js | 69 + .../lib/models/deletedCertificateBundle.js | 155 + .../lib/models/deletedCertificateItem.js | 114 + .../models/deletedCertificateListResult.js | 70 + .../keyvault/lib/models/deletedKeyBundle.js | 115 + .../keyvault/lib/models/deletedKeyItem.js | 114 + .../lib/models/deletedKeyListResult.js | 69 + .../lib/models/deletedSasDefinitionBundle.js | 142 + .../lib/models/deletedSasDefinitionItem.js | 118 + .../models/deletedSasDefinitionListResult.js | 70 + .../lib/models/deletedSecretBundle.js | 136 + .../keyvault/lib/models/deletedSecretItem.js | 120 + .../lib/models/deletedSecretListResult.js | 70 + .../lib/models/deletedStorageAccountItem.js | 118 + .../lib/models/deletedStorageBundle.js | 142 + .../lib/models/deletedStorageListResult.js | 70 + .../keyvault/lib/models/errorModel.js | 72 + lib/services/keyvault/lib/models/index.d.ts | 2204 + lib/services/keyvault/lib/models/index.js | 109 + .../keyvault/lib/models/issuerAttributes.js | 70 + .../keyvault/lib/models/issuerBundle.js | 99 + .../keyvault/lib/models/issuerCredentials.js | 60 + .../keyvault/lib/models/issuerParameters.js | 72 + .../keyvault/lib/models/jsonWebKey.js | 184 + .../keyvault/lib/models/keyAttributes.js | 100 + lib/services/keyvault/lib/models/keyBundle.js | 115 + .../lib/models/keyCreateParameters.js | 123 + .../lib/models/keyImportParameters.js | 115 + lib/services/keyvault/lib/models/keyItem.js | 93 + .../keyvault/lib/models/keyListResult.js | 69 + .../keyvault/lib/models/keyOperationResult.js | 62 + .../lib/models/keyOperationsParameters.js | 64 + .../keyvault/lib/models/keyProperties.js | 91 + .../lib/models/keyRestoreParameters.js | 53 + .../keyvault/lib/models/keySignParameters.js | 67 + .../lib/models/keyUpdateParameters.js | 92 + .../keyvault/lib/models/keyVaultError.js | 57 + .../lib/models/keyVerifyParameters.js | 74 + .../keyvault/lib/models/keyVerifyResult.js | 54 + .../keyvault/lib/models/lifetimeAction.js | 71 + .../lib/models/organizationDetails.js | 68 + .../pendingCertificateSigningRequestResult.js | 54 + .../lib/models/sasDefinitionAttributes.js | 86 + .../lib/models/sasDefinitionBundle.js | 131 + .../models/sasDefinitionCreateParameters.js | 109 + .../keyvault/lib/models/sasDefinitionItem.js | 99 + .../lib/models/sasDefinitionListResult.js | 69 + .../models/sasDefinitionUpdateParameters.js | 109 + .../keyvault/lib/models/secretAttributes.js | 101 + .../keyvault/lib/models/secretBundle.js | 121 + .../keyvault/lib/models/secretItem.js | 104 + .../keyvault/lib/models/secretListResult.js | 69 + .../keyvault/lib/models/secretProperties.js | 52 + .../lib/models/secretRestoreParameters.js | 53 + .../lib/models/secretSetParameters.js | 93 + .../lib/models/secretUpdateParameters.js | 85 + .../lib/models/storageAccountAttributes.js | 86 + .../models/storageAccountCreateParameters.js | 116 + .../keyvault/lib/models/storageAccountItem.js | 99 + .../storageAccountRegenerteKeyParameters.js | 52 + .../models/storageAccountUpdateParameters.js | 109 + .../keyvault/lib/models/storageBundle.js | 130 + .../keyvault/lib/models/storageListResult.js | 70 + .../lib/models/storageRestoreParameters.js | 53 + .../lib/models/subjectAlternativeNames.js | 89 + lib/services/keyvault/lib/models/trigger.js | 68 + .../lib/models/x509CertificateProperties.js | 107 + .../mediaServicesManagement/README.md | 6 +- .../lib/azureMediaServices.d.ts | 8 +- .../lib/azureMediaServices.js | 10 +- .../lib/models/accountFilter.js | 119 + .../lib/models/accountFilterCollection.js | 68 + .../lib/models/akamaiAccessControl.js | 2 - .../akamaiSignatureHeaderAuthenticationKey.js | 2 +- .../lib/models/apiError.js | 4 +- .../lib/models/asset.js | 4 + .../lib/models/assetFileEncryptionMetadata.js | 69 + .../lib/models/assetFilter.js | 119 + .../lib/models/assetFilterCollection.js | 68 + .../lib/models/assetStreamingLocator.js | 123 + .../lib/models/audioAnalyzerPreset.js | 8 +- .../models/builtInStandardEncoderPreset.js | 5 +- .../lib/models/cbcsDrmConfiguration.js | 2 - .../lib/models/cencDrmConfiguration.js | 2 - .../lib/models/commonEncryptionCbcs.js | 2 - .../lib/models/commonEncryptionCenc.js | 2 - .../lib/models/contentKeyPolicy.js | 3 + .../contentKeyPolicyFairPlayConfiguration.js | 3 +- .../lib/models/contentKeyPolicyOption.js | 3 +- .../contentKeyPolicyPlayReadyLicense.js | 2 - .../contentKeyPolicyPlayReadyPlayRight.js | 2 - .../lib/models/contentKeyPolicyProperties.js | 5 +- .../lib/models/envelopeEncryption.js | 2 - .../models/filterTrackPropertyCondition.js | 72 + .../lib/models/filterTrackSelection.js | 61 + .../lib/models/filters.js | 2 - .../lib/models/firstQuality.js | 52 + .../lib/models/iPAccessControl.js | 2 - .../lib/models/index.d.ts | 692 +- .../lib/models/index.js | 30 +- .../mediaServicesManagement/lib/models/job.js | 11 +- .../lib/models/jobError.js | 5 +- .../lib/models/jobInput.js | 13 - .../lib/models/jobInputAsset.js | 14 +- .../lib/models/jobInputClip.js | 20 +- .../lib/models/jobInputHttp.js | 14 +- .../lib/models/jobInputs.js | 7 - .../lib/models/jobOutput.js | 27 +- .../lib/models/jobOutputAsset.js | 9 + .../lib/models/listContainerSasInput.js | 2 +- .../lib/models/listContentKeysResponse.js | 2 - .../lib/models/listPathsResponse.js | 2 - .../models/listStreamingLocatorsResponse.js | 61 + .../lib/models/liveEvent.js | 40 +- .../lib/models/liveEventEncoding.js | 8 +- .../lib/models/liveEventInput.js | 20 +- .../lib/models/liveEventInputAccessControl.js | 54 + .../lib/models/liveEventPreview.js | 17 +- .../models/liveEventPreviewAccessControl.js | 2 - .../lib/models/liveOutput.js | 3 +- .../lib/models/mediaService.js | 1 + .../lib/models/metric.js | 112 + .../lib/models/metricDimension.js | 73 + .../lib/models/metricProperties.js | 56 + .../lib/models/noEncryption.js | 2 - .../lib/models/oDataError.js | 2 - .../lib/models/operation.js | 23 +- .../lib/models/presentationTimeRange.js | 95 + .../lib/models/serviceSpecification.js | 61 + .../storageEncryptedAssetDecryptionData.js | 69 + .../lib/models/streamingEndpoint.js | 9 +- .../models/streamingEndpointAccessControl.js | 2 - .../lib/models/streamingEntityScaleUnit.js | 2 +- .../lib/models/streamingLocator.js | 38 +- .../lib/models/streamingLocatorContentKey.js | 11 +- .../lib/models/streamingPolicy.js | 1 + .../lib/models/streamingPolicyContentKey.js | 2 - .../lib/models/streamingPolicyContentKeys.js | 2 - .../lib/models/subscriptionMediaService.js | 1 + .../lib/models/trackSelection.js | 2 - .../lib/models/transform.js | 2 + .../lib/models/transformOutput.js | 7 +- .../lib/models/videoAnalyzerPreset.js | 14 +- .../lib/operations/accountFilters.js | 1708 + .../lib/operations/assetFilters.js | 1754 + .../lib/operations/assets.js | 268 +- .../lib/operations/index.d.ts | 2749 +- .../lib/operations/index.js | 2 + .../lib/operations/jobs.js | 363 +- .../lib/operations/liveEvents.js | 504 +- .../lib/operations/liveOutputs.js | 18 +- .../lib/operations/locations.js | 6 +- .../lib/operations/streamingEndpoints.js | 132 +- .../lib/operations/streamingLocators.js | 111 +- .../mediaServicesManagement/package.json | 4 +- lib/services/resourceManagement/LICENSE.txt | 42 +- .../lib/feature/featureClient.d.ts | 121 +- .../lib/feature/featureClient.js | 430 +- .../lib/feature/models/featureResult.js | 2 - .../lib/feature/models/index.d.ts | 50 + .../lib/feature/models/index.js | 3 + .../lib/feature/models/operation.js | 66 + .../lib/feature/models/operationDisplay.js | 69 + .../lib/feature/models/operationListResult.js | 69 + .../lib/link/managementLinkClient.d.ts | 12 +- .../lib/link/managementLinkClient.js | 10 +- .../lib/link/models/index.d.ts | 57 +- .../lib/link/models/index.js | 3 + .../lib/link/models/operation.js | 67 + .../lib/link/models/operationDisplay.js | 77 + .../lib/link/models/operationListResult.js | 69 + .../lib/link/models/resourceLink.js | 13 +- .../lib/link/operations/index.d.ts | 117 + .../lib/link/operations/index.js | 1 + .../lib/link/operations/operations.js | 449 + .../lib/lock/managementLockClient.d.ts | 12 +- .../lib/lock/managementLockClient.js | 10 +- .../lib/lock/models/index.d.ts | 51 + .../lib/lock/models/index.js | 3 + .../lib/lock/models/managementLockObject.js | 1 + .../lib/lock/models/operation.js | 67 + .../lib/lock/models/operationDisplay.js | 69 + .../lib/lock/models/operationListResult.js | 69 + .../operations/authorizationOperations.js | 449 + .../lib/lock/operations/index.d.ts | 133 +- .../lib/lock/operations/index.js | 1 + .../lib/lock/operations/managementLocks.js | 24 - .../lib/managedApplicationClient.d.ts | 171 + .../lib/managedApplicationClient.js | 507 + .../lib/models/appliance.js | 199 + .../lib/models/applianceArtifact.js | 70 + .../lib/models/applianceDefinition.js | 184 + .../models/applianceDefinitionListResult.js | 68 + .../lib/models/applianceListResult.js | 68 + .../lib/models/appliancePatchable.js | 199 + .../models/applianceProviderAuthorization.js | 65 + .../lib/models/errorResponse.js | 70 + .../lib/models/genericResource.js | 131 + .../resourceManagement/lib/models/identity.js | 72 + .../resourceManagement/lib/models/index.d.ts | 377 + .../resourceManagement/lib/models/index.js | 37 + .../lib/models/operation.js | 66 + .../lib/models/operationDisplay.js | 69 + .../lib/models/operationListResult.js | 69 + .../resourceManagement/lib/models/plan.js | 84 + .../lib/models/planPatchable.js | 84 + .../resourceManagement/lib/models/resource.js | 98 + .../resourceManagement/lib/models/sku.js | 92 + .../lib/operations/applianceDefinitions.js | 3163 + .../lib/operations/appliances.js | 4508 + .../lib/operations/index.d.ts | 2697 + .../lib/operations/index.js | 18 + .../lib/policy/models/errorResponse.js | 4 +- .../lib/policy/models/identity.js | 72 + .../lib/policy/models/index.d.ts | 121 +- .../lib/policy/models/index.js | 5 +- .../lib/policy/models/policyAssignment.js | 31 +- .../lib/policy/models/policyDefinition.js | 10 + .../lib/policy/models/policySku.js | 2 +- .../lib/policy/operations/index.d.ts | 1630 +- .../lib/policy/operations/index.js | 2 +- .../policy/operations/policyAssignments.js | 965 +- .../policy/operations/policyDefinitions.js | 258 +- .../policy/operations/policySetDefinitions.js | 249 +- .../lib/policy/policyClient.d.ts | 15 +- .../lib/policy/policyClient.js | 12 +- .../lib/resource/models/aliasType.js | 2 - .../lib/resource/models/dependency.js | 2 - .../lib/resource/models/deployment.js | 18 +- .../lib/resource/models/deploymentExtended.js | 28 +- .../resource/models/deploymentOperation.js | 2 - .../models/deploymentOperationProperties.js | 2 - .../resource/models/deploymentProperties.js | 16 +- .../models/deploymentPropertiesExtended.js | 18 +- .../models/deploymentValidateResult.js | 12 +- .../lib/resource/models/genericResource.js | 7 +- .../lib/resource/models/identity.js | 23 +- .../identityUserAssignedIdentitiesValue.js | 61 + .../lib/resource/models/index.d.ts | 180 +- .../lib/resource/models/index.js | 6 + .../lib/resource/models/onErrorDeployment.js | 63 + .../models/onErrorDeploymentExtended.js | 73 + .../lib/resource/models/operation.js | 67 + .../lib/resource/models/operationDisplay.js | 77 + .../resource/models/operationListResult.js | 69 + .../lib/resource/models/provider.js | 2 - .../resource/models/providerResourceType.js | 2 - .../lib/resource/models/resource.js | 2 +- .../lib/resource/models/resourceGroup.js | 5 +- .../models/resourceGroupExportResult.js | 2 - .../resource/models/resourceGroupPatchable.js | 2 - .../resourceManagementErrorWithDetails.js | 2 - ...ourceProviderOperationDisplayProperties.js | 2 +- .../lib/resource/models/tagDetails.js | 3 +- .../lib/resource/models/tagValue.js | 5 +- .../operations/deploymentOperations.js | 1014 +- .../lib/resource/operations/deployments.js | 3879 +- .../lib/resource/operations/index.d.ts | 1817 +- .../lib/resource/operations/index.js | 1 + .../lib/resource/operations/operations.js | 449 + .../lib/resource/operations/resourceGroups.js | 6 - .../lib/resource/operations/resources.js | 192 +- .../resource/resourceManagementClient.d.ts | 12 +- .../lib/resource/resourceManagementClient.js | 12 +- .../lib/subscription/models/index.d.ts | 53 + .../lib/subscription/models/index.js | 3 + .../lib/subscription/models/operation.js | 67 + .../subscription/models/operationDisplay.js | 77 + .../models/operationListResult.js | 69 + .../lib/subscription/models/subscription.js | 2 - .../lib/subscription/operations/index.d.ts | 117 + .../lib/subscription/operations/index.js | 1 + .../lib/subscription/operations/operations.js | 449 + .../lib/subscription/subscriptionClient.d.ts | 12 +- .../lib/subscription/subscriptionClient.js | 10 +- .../serviceBusManagement2/LICENSE.txt | 42 +- lib/services/serviceBusManagement2/README.md | 77 +- .../lib/models/armDisasterRecovery.js | 10 + .../lib/models/captureDescription.js | 2 - .../lib/models/index.d.ts | 42 + .../serviceBusManagement2/lib/models/index.js | 2 + .../lib/models/migrationConfigListResult.js | 69 + .../lib/models/migrationConfigProperties.js | 121 + .../lib/models/operation.js | 2 - .../lib/operations/index.d.ts | 629 +- .../lib/operations/index.js | 1 + .../lib/operations/migrationConfigs.js | 1995 + .../lib/operations/queues.js | 58 + .../lib/operations/rules.js | 58 + .../lib/operations/subscriptions.js | 58 + .../lib/operations/topics.js | 58 + .../lib/serviceBusManagementClient.d.ts | 7 +- .../lib/serviceBusManagementClient.js | 7 +- .../serviceBusManagement2/package.json | 9 +- .../trafficManagerManagement2/LICENSE.txt | 42 +- .../trafficManagerManagement2/README.md | 88 +- .../lib/models/endpoint.js | 50 +- .../endpointPropertiesCustomHeadersItem.js | 60 + .../models/endpointPropertiesSubnetsItem.js | 69 + .../lib/models/heatMapModel.js | 3 - .../lib/models/index.d.ts | 281 +- .../lib/models/index.js | 14 +- .../lib/models/monitorConfig.js | 33 + .../models/monitorConfigCustomHeadersItem.js | 60 + ...nitorConfigExpectedStatusCodeRangesItem.js | 60 + .../lib/models/profile.js | 28 +- .../lib/models/proxyResource.js | 3 - .../lib/models/region.js | 2 - .../lib/models/resource.js | 3 - .../lib/models/trackedResource.js | 3 - .../lib/models/trafficFlow.js | 2 - .../trafficManagerGeographicHierarchy.js | 3 - .../lib/models/userMetricsModel.js | 77 + .../lib/operations/endpoints.js | 138 +- .../lib/operations/geographicHierarchies.js | 6 +- .../lib/operations/heatMap.js | 6 +- .../lib/operations/index.d.ts | 174 +- .../lib/operations/profiles.js | 138 +- .../trafficManagerUserMetricsKeys.js | 48 +- .../lib/trafficManagerManagementClient.d.ts | 8 +- .../lib/trafficManagerManagementClient.js | 7 +- .../trafficManagerManagement2/package.json | 6 +- lib/services/websiteManagement2/LICENSE.txt | 21 + lib/services/websiteManagement2/README.md | 40 + .../lib/models/abnormalTimePeriod.js | 92 + .../websiteManagement2/lib/models/address.js | 92 + .../lib/models/addressResponse.js | 93 + .../lib/models/analysisData.js | 121 + .../lib/models/analysisDefinition.js | 88 + .../lib/models/apiDefinitionInfo.js | 52 + .../lib/models/appServiceCertificate.js | 75 + .../models/appServiceCertificateCollection.js | 68 + .../lib/models/appServiceCertificateOrder.js | 337 + .../appServiceCertificateOrderCollection.js | 68 + ...appServiceCertificateOrderPatchResource.js | 316 + .../appServiceCertificatePatchResource.js | 111 + .../models/appServiceCertificateResource.js | 132 + .../lib/models/appServiceEnvironment.js | 469 + .../models/appServiceEnvironmentCollection.js | 68 + .../appServiceEnvironmentPatchResource.js | 505 + .../models/appServiceEnvironmentResource.js | 526 + .../lib/models/appServicePlan.js | 327 + .../lib/models/appServicePlanCollection.js | 68 + .../lib/models/appServicePlanPatchResource.js | 278 + .../lib/models/applicationLogsConfig.js | 87 + .../lib/models/applicationStack.js | 101 + .../lib/models/applicationStackCollection.js | 68 + .../lib/models/autoHealActions.js | 75 + .../lib/models/autoHealCustomAction.js | 61 + .../lib/models/autoHealRules.js | 84 + .../lib/models/autoHealTriggers.js | 91 + .../azureBlobStorageApplicationLogsConfig.js | 73 + .../models/azureBlobStorageHttpLogsConfig.js | 72 + .../lib/models/azureStorageInfoValue.js | 99 + .../azureStoragePropertyDictionaryResource.js | 95 + .../azureTableStorageApplicationLogsConfig.js | 63 + .../lib/models/backupItem.js | 223 + .../lib/models/backupItemCollection.js | 68 + .../lib/models/backupRequest.js | 147 + .../lib/models/backupSchedule.js | 108 + .../lib/models/billingMeter.js | 129 + .../lib/models/billingMeterCollection.js | 68 + .../lib/models/capability.js | 68 + .../lib/models/certificate.js | 288 + .../lib/models/certificateCollection.js | 68 + .../lib/models/certificateDetails.js | 125 + .../lib/models/certificateEmail.js | 95 + .../lib/models/certificateOrderAction.js | 104 + .../lib/models/certificatePatchResource.js | 267 + .../lib/models/cloningInfo.js | 150 + .../lib/models/connStringInfo.js | 71 + .../lib/models/connStringValueTypePair.js | 63 + .../lib/models/connectionStringDictionary.js | 95 + .../websiteManagement2/lib/models/contact.js | 129 + .../lib/models/continuousWebJob.js | 170 + .../lib/models/continuousWebJobCollection.js | 68 + .../lib/models/corsSettings.js | 61 + .../lib/models/csmMoveResourceEnvelope.js | 73 + .../lib/models/csmOperationCollection.js | 68 + .../lib/models/csmOperationDescription.js | 85 + .../csmOperationDescriptionProperties.js | 55 + .../lib/models/csmOperationDisplay.js | 76 + .../lib/models/csmPublishingProfileOptions.js | 64 + .../lib/models/csmSlotEntity.js | 62 + .../lib/models/csmUsageQuota.js | 87 + .../lib/models/csmUsageQuotaCollection.js | 68 + .../models/customHostnameAnalysisResult.js | 232 + .../lib/models/dataSource.js | 75 + .../lib/models/dataTableResponseColumn.js | 69 + .../lib/models/dataTableResponseObject.js | 90 + .../lib/models/databaseBackupSetting.js | 81 + .../lib/models/defaultErrorResponse.js | 62 + .../lib/models/defaultErrorResponseError.js | 99 + .../defaultErrorResponseErrorDetailsItem.js | 74 + .../lib/models/deletedAppRestoreRequest.js | 108 + .../lib/models/deletedSite.js | 143 + .../lib/models/deletedWebAppCollection.js | 68 + .../lib/models/deployment.js | 152 + .../lib/models/deploymentCollection.js | 68 + .../lib/models/deploymentLocations.js | 95 + .../lib/models/detectorAbnormalTimePeriod.js | 135 + .../lib/models/detectorDefinition.js | 116 + .../lib/models/detectorInfo.js | 81 + .../lib/models/detectorResponse.js | 109 + .../lib/models/detectorResponseCollection.js | 68 + .../lib/models/diagnosticAnalysis.js | 144 + .../models/diagnosticAnalysisCollection.js | 68 + .../lib/models/diagnosticCategory.js | 88 + .../models/diagnosticCategoryCollection.js | 68 + .../lib/models/diagnosticData.js | 71 + .../models/diagnosticDetectorCollection.js | 68 + .../lib/models/diagnosticDetectorResponse.js | 189 + .../lib/models/diagnosticMetricSample.js | 102 + .../lib/models/diagnosticMetricSet.js | 103 + .../lib/models/dimension.js | 78 + .../websiteManagement2/lib/models/domain.js | 414 + .../models/domainAvailablilityCheckResult.js | 73 + .../lib/models/domainCollection.js | 68 + .../models/domainControlCenterSsoRequest.js | 72 + .../lib/models/domainOwnershipIdentifier.js | 87 + .../domainOwnershipIdentifierCollection.js | 68 + .../lib/models/domainPatchResource.js | 393 + .../lib/models/domainPurchaseConsent.js | 78 + .../domainRecommendationSearchParameters.js | 62 + .../lib/models/enabledConfig.js | 53 + .../lib/models/errorEntity.js | 107 + .../lib/models/experiments.js | 60 + .../models/fileSystemApplicationLogsConfig.js | 55 + .../lib/models/fileSystemHttpLogsConfig.js | 78 + .../lib/models/functionEnvelope.js | 159 + .../lib/models/functionEnvelopeCollection.js | 68 + .../lib/models/functionSecrets.js | 95 + .../lib/models/geoRegion.js | 97 + .../lib/models/geoRegionCollection.js | 68 + .../lib/models/globalCsmSkuDescription.js | 125 + .../lib/models/handlerMapping.js | 74 + .../websiteManagement2/lib/models/hostName.js | 110 + .../lib/models/hostNameBinding.js | 161 + .../lib/models/hostNameBindingCollection.js | 68 + .../lib/models/hostNameSslState.js | 98 + .../hostingEnvironmentDeploymentInfo.js | 60 + .../models/hostingEnvironmentDiagnostics.js | 60 + .../lib/models/hostingEnvironmentProfile.js | 70 + .../lib/models/httpLogsConfig.js | 79 + .../lib/models/hybridConnection.js | 148 + .../lib/models/hybridConnectionCollection.js | 68 + .../lib/models/hybridConnectionKey.js | 98 + .../lib/models/hybridConnectionLimits.js | 99 + .../lib/models/identifier.js | 87 + .../lib/models/identifierCollection.js | 68 + .../websiteManagement2/lib/models/index.d.ts | 7626 + .../websiteManagement2/lib/models/index.js | 293 + .../lib/models/ipSecurityRestriction.js | 108 + .../lib/models/localizableString.js | 60 + .../lib/models/logSpecification.js | 68 + .../websiteManagement2/lib/models/mSDeploy.js | 152 + .../lib/models/mSDeployLog.js | 96 + .../lib/models/mSDeployLogEntry.js | 73 + .../lib/models/mSDeployStatus.js | 127 + .../lib/models/managedServiceIdentity.js | 87 + .../lib/models/metricAvailabilily.js | 60 + .../lib/models/metricAvailability.js | 60 + .../lib/models/metricDefinition.js | 124 + .../lib/models/metricSpecification.js | 180 + .../lib/models/migrateMySqlRequest.js | 98 + .../lib/models/migrateMySqlStatus.js | 110 + .../lib/models/nameIdentifier.js | 52 + .../lib/models/nameIdentifierCollection.js | 68 + .../lib/models/nameValuePair.js | 60 + .../lib/models/networkAccessControlEntry.js | 79 + .../lib/models/networkFeatures.js | 150 + .../lib/models/networkTrace.js | 71 + .../lib/models/operation.js | 119 + .../lib/models/perfMonCounterCollection.js | 68 + .../lib/models/perfMonResponse.js | 75 + .../lib/models/perfMonSample.js | 69 + .../lib/models/perfMonSet.js | 93 + .../lib/models/premierAddOn.js | 141 + .../lib/models/premierAddOnOffer.js | 163 + .../lib/models/premierAddOnOfferCollection.js | 68 + .../lib/models/premierAddOnPatchResource.js | 120 + .../lib/models/privateAccess.js | 104 + .../lib/models/privateAccessSubnet.js | 61 + .../lib/models/privateAccessVirtualNetwork.js | 86 + .../lib/models/processInfo.js | 406 + .../lib/models/processInfoCollection.js | 68 + .../lib/models/processModuleInfo.js | 168 + .../lib/models/processModuleInfoCollection.js | 68 + .../lib/models/processThreadInfo.js | 184 + .../lib/models/processThreadInfoCollection.js | 68 + .../lib/models/proxyOnlyResource.js | 84 + .../lib/models/publicCertificate.js | 106 + .../lib/models/publicCertificateCollection.js | 68 + .../lib/models/pushSettings.js | 121 + .../lib/models/rampUpRule.js | 125 + .../lib/models/recommendation.js | 300 + .../lib/models/recommendationCollection.js | 68 + .../lib/models/recommendationRule.js | 205 + .../models/reissueCertificateOrderRequest.js | 113 + .../models/relayServiceConnectionEntity.js | 135 + .../lib/models/rendering.js | 71 + .../models/renewCertificateOrderRequest.js | 104 + .../lib/models/requestsBasedTrigger.js | 60 + .../websiteManagement2/lib/models/resource.js | 106 + .../lib/models/resourceCollection.js | 67 + .../lib/models/resourceHealthMetadata.js | 97 + .../resourceHealthMetadataCollection.js | 68 + .../lib/models/resourceMetric.js | 144 + .../lib/models/resourceMetricAvailability.js | 62 + .../lib/models/resourceMetricCollection.js | 68 + .../lib/models/resourceMetricDefinition.js | 140 + .../resourceMetricDefinitionCollection.js | 68 + .../lib/models/resourceMetricName.js | 62 + .../lib/models/resourceMetricProperty.js | 60 + .../lib/models/resourceMetricValue.js | 115 + .../lib/models/resourceNameAvailability.js | 78 + .../models/resourceNameAvailabilityRequest.js | 71 + .../lib/models/responseMetaData.js | 55 + .../lib/models/restoreRequest.js | 194 + .../lib/models/serviceSpecification.js | 76 + .../websiteManagement2/lib/models/site.js | 672 + .../lib/models/siteAuthSettings.js | 410 + .../lib/models/siteCloneability.js | 106 + .../lib/models/siteCloneabilityCriterion.js | 60 + .../lib/models/siteConfig.js | 610 + .../lib/models/siteConfigResource.js | 645 + .../models/siteConfigResourceCollection.js | 68 + .../models/siteConfigurationSnapshotInfo.js | 97 + ...siteConfigurationSnapshotInfoCollection.js | 69 + .../lib/models/siteExtensionInfo.js | 250 + .../lib/models/siteExtensionInfoCollection.js | 68 + .../lib/models/siteInstance.js | 88 + .../lib/models/siteLimits.js | 68 + .../lib/models/siteLogsConfig.js | 165 + .../lib/models/siteMachineKey.js | 76 + .../lib/models/sitePatchResource.js | 635 + .../lib/models/sitePhpErrorLogFlag.js | 113 + .../websiteManagement2/lib/models/siteSeal.js | 52 + .../lib/models/siteSealRequest.js | 61 + .../lib/models/siteSourceControl.js | 123 + .../lib/models/skuCapacity.js | 80 + .../lib/models/skuDescription.js | 135 + .../websiteManagement2/lib/models/skuInfo.js | 97 + .../lib/models/skuInfoCollection.js | 68 + .../websiteManagement2/lib/models/skuInfos.js | 68 + .../lib/models/slotConfigNamesResource.js | 125 + .../lib/models/slotDifference.js | 147 + .../lib/models/slotDifferenceCollection.js | 68 + .../lib/models/slotSwapStatus.js | 74 + .../lib/models/slowRequestsBasedTrigger.js | 68 + .../websiteManagement2/lib/models/snapshot.js | 88 + .../lib/models/snapshotCollection.js | 69 + .../lib/models/snapshotRecoverySource.js | 65 + .../lib/models/snapshotRestoreRequest.js | 134 + .../websiteManagement2/lib/models/solution.js | 132 + .../lib/models/sourceControl.js | 111 + .../lib/models/sourceControlCollection.js | 68 + .../lib/models/stackMajorVersion.js | 88 + .../lib/models/stackMinorVersion.js | 71 + .../lib/models/stampCapacity.js | 144 + .../lib/models/stampCapacityCollection.js | 68 + .../lib/models/statusCodesBasedTrigger.js | 84 + .../lib/models/storageMigrationOptions.js | 117 + .../lib/models/storageMigrationResponse.js | 90 + .../lib/models/stringDictionary.js | 94 + .../lib/models/swiftVirtualNetwork.js | 99 + .../lib/models/tldLegalAgreement.js | 77 + .../lib/models/tldLegalAgreementCollection.js | 68 + .../lib/models/topLevelDomain.js | 88 + .../models/topLevelDomainAgreementOption.js | 64 + .../lib/models/topLevelDomainCollection.js | 68 + .../lib/models/triggeredJobHistory.js | 96 + .../models/triggeredJobHistoryCollection.js | 68 + .../lib/models/triggeredJobRun.js | 169 + .../lib/models/triggeredWebJob.js | 181 + .../lib/models/triggeredWebJobCollection.js | 68 + .../websiteManagement2/lib/models/usage.js | 153 + .../lib/models/usageCollection.js | 68 + .../websiteManagement2/lib/models/user.js | 121 + .../lib/models/validateRequest.js | 135 + .../lib/models/validateResponse.js | 63 + .../lib/models/validateResponseError.js | 60 + .../lib/models/virtualApplication.js | 86 + .../lib/models/virtualDirectory.js | 60 + .../lib/models/virtualIPMapping.js | 76 + .../lib/models/virtualNetworkProfile.js | 78 + .../lib/models/vnetGateway.js | 97 + .../websiteManagement2/lib/models/vnetInfo.js | 143 + .../lib/models/vnetParameters.js | 104 + .../lib/models/vnetRoute.js | 114 + .../models/vnetValidationFailureDetails.js | 105 + .../lib/models/vnetValidationTestFailure.js | 96 + .../lib/models/webAppCollection.js | 68 + .../lib/models/webAppInstanceCollection.js | 68 + .../websiteManagement2/lib/models/webJob.js | 144 + .../lib/models/webJobCollection.js | 68 + .../lib/models/workerPool.js | 96 + .../lib/models/workerPoolCollection.js | 68 + .../lib/models/workerPoolResource.js | 159 + .../operations/appServiceCertificateOrders.js | 6829 + .../lib/operations/appServiceEnvironments.js | 19842 +++ .../lib/operations/appServicePlans.js | 10631 ++ .../certificateRegistrationProvider.js | 479 + .../lib/operations/certificates.js | 2108 + .../lib/operations/deletedWebApps.js | 471 + .../lib/operations/diagnostics.js | 8797 + .../operations/domainRegistrationProvider.js | 479 + .../lib/operations/domains.js | 5727 + .../lib/operations/index.d.ts | 60006 +++++++ .../lib/operations/index.js | 30 + .../lib/operations/provider.js | 1391 + .../lib/operations/recommendations.js | 2988 + .../resourceHealthMetadataOperations.js | 2482 + .../lib/operations/topLevelDomains.js | 1211 + .../lib/operations/webApps.js | 126902 +++++++++++++++ .../lib/webSiteManagementClient.d.ts | 1524 + .../lib/webSiteManagementClient.js | 5301 + lib/services/websiteManagement2/package.json | 25 + 897 files changed, 437948 insertions(+), 11285 deletions(-) create mode 100644 lib/services/applicationinsights/lib/models/annotationsListResult.js create mode 100644 lib/services/applicationinsights/lib/models/workItemConfigurationsListResult.js create mode 100644 lib/services/applicationinsights/lib/models/workbooksListResult.js create mode 100644 lib/services/applicationinsights/lib/operations/analyticsItems.js create mode 100644 lib/services/applicationinsights/lib/operations/workbooks.js create mode 100644 lib/services/authorizationManagement/lib/models/denyAssignment.js create mode 100644 lib/services/authorizationManagement/lib/models/denyAssignmentFilter.js create mode 100644 lib/services/authorizationManagement/lib/models/denyAssignmentListResult.js create mode 100644 lib/services/authorizationManagement/lib/models/denyAssignmentPermission.js create mode 100644 lib/services/authorizationManagement/lib/models/principal.js create mode 100644 lib/services/authorizationManagement/lib/operations/denyAssignments.js create mode 100644 lib/services/computeManagement2/lib/models/additionalCapabilities.js create mode 100644 lib/services/computeManagement2/lib/models/automaticOSUpgradePolicy.js create mode 100644 lib/services/computeManagement2/lib/models/diffDiskSettings.js create mode 100644 lib/services/computeManagement2/lib/models/disallowed.js create mode 100644 lib/services/computeManagement2/lib/models/gallery.js create mode 100644 lib/services/computeManagement2/lib/models/galleryArtifactPublishingProfileBase.js create mode 100644 lib/services/computeManagement2/lib/models/galleryArtifactSource.js create mode 100644 lib/services/computeManagement2/lib/models/galleryDataDiskImage.js create mode 100644 lib/services/computeManagement2/lib/models/galleryDiskImage.js create mode 100644 lib/services/computeManagement2/lib/models/galleryIdentifier.js create mode 100644 lib/services/computeManagement2/lib/models/galleryImage.js create mode 100644 lib/services/computeManagement2/lib/models/galleryImageIdentifier.js create mode 100644 lib/services/computeManagement2/lib/models/galleryImageList.js create mode 100644 lib/services/computeManagement2/lib/models/galleryImageVersion.js create mode 100644 lib/services/computeManagement2/lib/models/galleryImageVersionList.js create mode 100644 lib/services/computeManagement2/lib/models/galleryImageVersionPublishingProfile.js create mode 100644 lib/services/computeManagement2/lib/models/galleryImageVersionStorageProfile.js create mode 100644 lib/services/computeManagement2/lib/models/galleryList.js create mode 100644 lib/services/computeManagement2/lib/models/galleryOSDiskImage.js create mode 100644 lib/services/computeManagement2/lib/models/imagePurchasePlan.js create mode 100644 lib/services/computeManagement2/lib/models/managedArtifact.js create mode 100644 lib/services/computeManagement2/lib/models/recommendedMachineConfiguration.js create mode 100644 lib/services/computeManagement2/lib/models/regionalReplicationStatus.js create mode 100644 lib/services/computeManagement2/lib/models/replicationStatus.js create mode 100644 lib/services/computeManagement2/lib/models/resourceRange.js create mode 100644 lib/services/computeManagement2/lib/models/rollbackStatusInfo.js create mode 100644 lib/services/computeManagement2/lib/models/targetRegion.js create mode 100644 lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js create mode 100644 lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js create mode 100644 lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js create mode 100644 lib/services/computeManagement2/lib/models/virtualMachineIdentityUserAssignedIdentitiesValue.js create mode 100644 lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentityUserAssignedIdentitiesValue.js create mode 100644 lib/services/computeManagement2/lib/models/virtualMachineScaleSetIpTag.js create mode 100644 lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js create mode 100644 lib/services/computeManagement2/lib/operations/galleries.js create mode 100644 lib/services/computeManagement2/lib/operations/galleryImageVersions.js create mode 100644 lib/services/computeManagement2/lib/operations/galleryImages.js create mode 100644 lib/services/frontdoorManagement/LICENSE.txt create mode 100644 lib/services/frontdoorManagement/README.md create mode 100644 lib/services/frontdoorManagement/lib/frontdoorManagementClient.d.ts create mode 100644 lib/services/frontdoorManagement/lib/frontdoorManagementClient.js create mode 100644 lib/services/frontdoorManagement/lib/models/azureAsyncOperationResult.js create mode 100644 lib/services/frontdoorManagement/lib/models/azureManagedOverrideRuleGroup.js create mode 100644 lib/services/frontdoorManagement/lib/models/azureManagedRuleSet.js create mode 100644 lib/services/frontdoorManagement/lib/models/backend.js create mode 100644 lib/services/frontdoorManagement/lib/models/backendPool.js create mode 100644 lib/services/frontdoorManagement/lib/models/backendPoolListResult.js create mode 100644 lib/services/frontdoorManagement/lib/models/backendPoolUpdateParameters.js create mode 100644 lib/services/frontdoorManagement/lib/models/cacheConfiguration.js create mode 100644 lib/services/frontdoorManagement/lib/models/checkNameAvailabilityInput.js create mode 100644 lib/services/frontdoorManagement/lib/models/checkNameAvailabilityOutput.js create mode 100644 lib/services/frontdoorManagement/lib/models/customHttpsConfiguration.js create mode 100644 lib/services/frontdoorManagement/lib/models/customRule.js create mode 100644 lib/services/frontdoorManagement/lib/models/customRules.js create mode 100644 lib/services/frontdoorManagement/lib/models/errorDetails.js create mode 100644 lib/services/frontdoorManagement/lib/models/errorModel.js create mode 100644 lib/services/frontdoorManagement/lib/models/errorResponse.js create mode 100644 lib/services/frontdoorManagement/lib/models/frontDoor.js create mode 100644 lib/services/frontdoorManagement/lib/models/frontDoorListResult.js create mode 100644 lib/services/frontdoorManagement/lib/models/frontDoorUpdateParameters.js create mode 100644 lib/services/frontdoorManagement/lib/models/frontendEndpoint.js create mode 100644 lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParameters.js create mode 100644 lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.js create mode 100644 lib/services/frontdoorManagement/lib/models/frontendEndpointsListResult.js create mode 100644 lib/services/frontdoorManagement/lib/models/healthProbeSettingsListResult.js create mode 100644 lib/services/frontdoorManagement/lib/models/healthProbeSettingsModel.js create mode 100644 lib/services/frontdoorManagement/lib/models/healthProbeSettingsUpdateParameters.js create mode 100644 lib/services/frontdoorManagement/lib/models/index.d.ts create mode 100644 lib/services/frontdoorManagement/lib/models/index.js create mode 100644 lib/services/frontdoorManagement/lib/models/keyVaultCertificateSourceParametersVault.js create mode 100644 lib/services/frontdoorManagement/lib/models/loadBalancingSettingsListResult.js create mode 100644 lib/services/frontdoorManagement/lib/models/loadBalancingSettingsModel.js create mode 100644 lib/services/frontdoorManagement/lib/models/loadBalancingSettingsUpdateParameters.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleSet.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleSets.js create mode 100644 lib/services/frontdoorManagement/lib/models/matchCondition1.js create mode 100644 lib/services/frontdoorManagement/lib/models/policySettings.js create mode 100644 lib/services/frontdoorManagement/lib/models/purgeParameters.js create mode 100644 lib/services/frontdoorManagement/lib/models/resource.js create mode 100644 lib/services/frontdoorManagement/lib/models/routingRule.js create mode 100644 lib/services/frontdoorManagement/lib/models/routingRuleListResult.js create mode 100644 lib/services/frontdoorManagement/lib/models/routingRuleUpdateParameters.js create mode 100644 lib/services/frontdoorManagement/lib/models/subResource.js create mode 100644 lib/services/frontdoorManagement/lib/models/tagsObject.js create mode 100644 lib/services/frontdoorManagement/lib/models/validateCustomDomainInput.js create mode 100644 lib/services/frontdoorManagement/lib/models/validateCustomDomainOutput.js create mode 100644 lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicy1.js create mode 100644 lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicyListResult.js create mode 100644 lib/services/frontdoorManagement/lib/operations/backendPools.js create mode 100644 lib/services/frontdoorManagement/lib/operations/endpoints.js create mode 100644 lib/services/frontdoorManagement/lib/operations/frontDoors.js create mode 100644 lib/services/frontdoorManagement/lib/operations/frontendEndpoints.js create mode 100644 lib/services/frontdoorManagement/lib/operations/healthProbeSettings.js create mode 100644 lib/services/frontdoorManagement/lib/operations/index.d.ts create mode 100644 lib/services/frontdoorManagement/lib/operations/index.js create mode 100644 lib/services/frontdoorManagement/lib/operations/loadBalancingSettings.js create mode 100644 lib/services/frontdoorManagement/lib/operations/policies.js create mode 100644 lib/services/frontdoorManagement/lib/operations/routingRules.js create mode 100644 lib/services/frontdoorManagement/package.json create mode 100644 lib/services/keyvault/LICENSE.txt create mode 100644 lib/services/keyvault/lib/keyVaultClient.d.ts create mode 100644 lib/services/keyvault/lib/keyVaultClient.js create mode 100644 lib/services/keyvault/lib/models/action.js create mode 100644 lib/services/keyvault/lib/models/administratorDetails.js create mode 100644 lib/services/keyvault/lib/models/attributes.js create mode 100644 lib/services/keyvault/lib/models/backupCertificateResult.js create mode 100644 lib/services/keyvault/lib/models/backupKeyResult.js create mode 100644 lib/services/keyvault/lib/models/backupSecretResult.js create mode 100644 lib/services/keyvault/lib/models/backupStorageResult.js create mode 100644 lib/services/keyvault/lib/models/certificateAttributes.js create mode 100644 lib/services/keyvault/lib/models/certificateBundle.js create mode 100644 lib/services/keyvault/lib/models/certificateCreateParameters.js create mode 100644 lib/services/keyvault/lib/models/certificateImportParameters.js create mode 100644 lib/services/keyvault/lib/models/certificateIssuerItem.js create mode 100644 lib/services/keyvault/lib/models/certificateIssuerListResult.js create mode 100644 lib/services/keyvault/lib/models/certificateIssuerSetParameters.js create mode 100644 lib/services/keyvault/lib/models/certificateIssuerUpdateParameters.js create mode 100644 lib/services/keyvault/lib/models/certificateItem.js create mode 100644 lib/services/keyvault/lib/models/certificateListResult.js create mode 100644 lib/services/keyvault/lib/models/certificateMergeParameters.js create mode 100644 lib/services/keyvault/lib/models/certificateOperation.js create mode 100644 lib/services/keyvault/lib/models/certificateOperationUpdateParameter.js create mode 100644 lib/services/keyvault/lib/models/certificatePolicy.js create mode 100644 lib/services/keyvault/lib/models/certificateRestoreParameters.js create mode 100644 lib/services/keyvault/lib/models/certificateUpdateParameters.js create mode 100644 lib/services/keyvault/lib/models/contact.js create mode 100644 lib/services/keyvault/lib/models/contacts.js create mode 100644 lib/services/keyvault/lib/models/deletedCertificateBundle.js create mode 100644 lib/services/keyvault/lib/models/deletedCertificateItem.js create mode 100644 lib/services/keyvault/lib/models/deletedCertificateListResult.js create mode 100644 lib/services/keyvault/lib/models/deletedKeyBundle.js create mode 100644 lib/services/keyvault/lib/models/deletedKeyItem.js create mode 100644 lib/services/keyvault/lib/models/deletedKeyListResult.js create mode 100644 lib/services/keyvault/lib/models/deletedSasDefinitionBundle.js create mode 100644 lib/services/keyvault/lib/models/deletedSasDefinitionItem.js create mode 100644 lib/services/keyvault/lib/models/deletedSasDefinitionListResult.js create mode 100644 lib/services/keyvault/lib/models/deletedSecretBundle.js create mode 100644 lib/services/keyvault/lib/models/deletedSecretItem.js create mode 100644 lib/services/keyvault/lib/models/deletedSecretListResult.js create mode 100644 lib/services/keyvault/lib/models/deletedStorageAccountItem.js create mode 100644 lib/services/keyvault/lib/models/deletedStorageBundle.js create mode 100644 lib/services/keyvault/lib/models/deletedStorageListResult.js create mode 100644 lib/services/keyvault/lib/models/errorModel.js create mode 100644 lib/services/keyvault/lib/models/index.d.ts create mode 100644 lib/services/keyvault/lib/models/index.js create mode 100644 lib/services/keyvault/lib/models/issuerAttributes.js create mode 100644 lib/services/keyvault/lib/models/issuerBundle.js create mode 100644 lib/services/keyvault/lib/models/issuerCredentials.js create mode 100644 lib/services/keyvault/lib/models/issuerParameters.js create mode 100644 lib/services/keyvault/lib/models/jsonWebKey.js create mode 100644 lib/services/keyvault/lib/models/keyAttributes.js create mode 100644 lib/services/keyvault/lib/models/keyBundle.js create mode 100644 lib/services/keyvault/lib/models/keyCreateParameters.js create mode 100644 lib/services/keyvault/lib/models/keyImportParameters.js create mode 100644 lib/services/keyvault/lib/models/keyItem.js create mode 100644 lib/services/keyvault/lib/models/keyListResult.js create mode 100644 lib/services/keyvault/lib/models/keyOperationResult.js create mode 100644 lib/services/keyvault/lib/models/keyOperationsParameters.js create mode 100644 lib/services/keyvault/lib/models/keyProperties.js create mode 100644 lib/services/keyvault/lib/models/keyRestoreParameters.js create mode 100644 lib/services/keyvault/lib/models/keySignParameters.js create mode 100644 lib/services/keyvault/lib/models/keyUpdateParameters.js create mode 100644 lib/services/keyvault/lib/models/keyVaultError.js create mode 100644 lib/services/keyvault/lib/models/keyVerifyParameters.js create mode 100644 lib/services/keyvault/lib/models/keyVerifyResult.js create mode 100644 lib/services/keyvault/lib/models/lifetimeAction.js create mode 100644 lib/services/keyvault/lib/models/organizationDetails.js create mode 100644 lib/services/keyvault/lib/models/pendingCertificateSigningRequestResult.js create mode 100644 lib/services/keyvault/lib/models/sasDefinitionAttributes.js create mode 100644 lib/services/keyvault/lib/models/sasDefinitionBundle.js create mode 100644 lib/services/keyvault/lib/models/sasDefinitionCreateParameters.js create mode 100644 lib/services/keyvault/lib/models/sasDefinitionItem.js create mode 100644 lib/services/keyvault/lib/models/sasDefinitionListResult.js create mode 100644 lib/services/keyvault/lib/models/sasDefinitionUpdateParameters.js create mode 100644 lib/services/keyvault/lib/models/secretAttributes.js create mode 100644 lib/services/keyvault/lib/models/secretBundle.js create mode 100644 lib/services/keyvault/lib/models/secretItem.js create mode 100644 lib/services/keyvault/lib/models/secretListResult.js create mode 100644 lib/services/keyvault/lib/models/secretProperties.js create mode 100644 lib/services/keyvault/lib/models/secretRestoreParameters.js create mode 100644 lib/services/keyvault/lib/models/secretSetParameters.js create mode 100644 lib/services/keyvault/lib/models/secretUpdateParameters.js create mode 100644 lib/services/keyvault/lib/models/storageAccountAttributes.js create mode 100644 lib/services/keyvault/lib/models/storageAccountCreateParameters.js create mode 100644 lib/services/keyvault/lib/models/storageAccountItem.js create mode 100644 lib/services/keyvault/lib/models/storageAccountRegenerteKeyParameters.js create mode 100644 lib/services/keyvault/lib/models/storageAccountUpdateParameters.js create mode 100644 lib/services/keyvault/lib/models/storageBundle.js create mode 100644 lib/services/keyvault/lib/models/storageListResult.js create mode 100644 lib/services/keyvault/lib/models/storageRestoreParameters.js create mode 100644 lib/services/keyvault/lib/models/subjectAlternativeNames.js create mode 100644 lib/services/keyvault/lib/models/trigger.js create mode 100644 lib/services/keyvault/lib/models/x509CertificateProperties.js create mode 100644 lib/services/mediaServicesManagement/lib/models/accountFilter.js create mode 100644 lib/services/mediaServicesManagement/lib/models/accountFilterCollection.js create mode 100644 lib/services/mediaServicesManagement/lib/models/assetFileEncryptionMetadata.js create mode 100644 lib/services/mediaServicesManagement/lib/models/assetFilter.js create mode 100644 lib/services/mediaServicesManagement/lib/models/assetFilterCollection.js create mode 100644 lib/services/mediaServicesManagement/lib/models/assetStreamingLocator.js create mode 100644 lib/services/mediaServicesManagement/lib/models/filterTrackPropertyCondition.js create mode 100644 lib/services/mediaServicesManagement/lib/models/filterTrackSelection.js create mode 100644 lib/services/mediaServicesManagement/lib/models/firstQuality.js create mode 100644 lib/services/mediaServicesManagement/lib/models/listStreamingLocatorsResponse.js create mode 100644 lib/services/mediaServicesManagement/lib/models/liveEventInputAccessControl.js create mode 100644 lib/services/mediaServicesManagement/lib/models/metric.js create mode 100644 lib/services/mediaServicesManagement/lib/models/metricDimension.js create mode 100644 lib/services/mediaServicesManagement/lib/models/metricProperties.js create mode 100644 lib/services/mediaServicesManagement/lib/models/presentationTimeRange.js create mode 100644 lib/services/mediaServicesManagement/lib/models/serviceSpecification.js create mode 100644 lib/services/mediaServicesManagement/lib/models/storageEncryptedAssetDecryptionData.js create mode 100644 lib/services/mediaServicesManagement/lib/operations/accountFilters.js create mode 100644 lib/services/mediaServicesManagement/lib/operations/assetFilters.js create mode 100644 lib/services/resourceManagement/lib/feature/models/operation.js create mode 100644 lib/services/resourceManagement/lib/feature/models/operationDisplay.js create mode 100644 lib/services/resourceManagement/lib/feature/models/operationListResult.js create mode 100644 lib/services/resourceManagement/lib/link/models/operation.js create mode 100644 lib/services/resourceManagement/lib/link/models/operationDisplay.js create mode 100644 lib/services/resourceManagement/lib/link/models/operationListResult.js create mode 100644 lib/services/resourceManagement/lib/link/operations/operations.js create mode 100644 lib/services/resourceManagement/lib/lock/models/operation.js create mode 100644 lib/services/resourceManagement/lib/lock/models/operationDisplay.js create mode 100644 lib/services/resourceManagement/lib/lock/models/operationListResult.js create mode 100644 lib/services/resourceManagement/lib/lock/operations/authorizationOperations.js create mode 100644 lib/services/resourceManagement/lib/managedApplicationClient.d.ts create mode 100644 lib/services/resourceManagement/lib/managedApplicationClient.js create mode 100644 lib/services/resourceManagement/lib/models/appliance.js create mode 100644 lib/services/resourceManagement/lib/models/applianceArtifact.js create mode 100644 lib/services/resourceManagement/lib/models/applianceDefinition.js create mode 100644 lib/services/resourceManagement/lib/models/applianceDefinitionListResult.js create mode 100644 lib/services/resourceManagement/lib/models/applianceListResult.js create mode 100644 lib/services/resourceManagement/lib/models/appliancePatchable.js create mode 100644 lib/services/resourceManagement/lib/models/applianceProviderAuthorization.js create mode 100644 lib/services/resourceManagement/lib/models/errorResponse.js create mode 100644 lib/services/resourceManagement/lib/models/genericResource.js create mode 100644 lib/services/resourceManagement/lib/models/identity.js create mode 100644 lib/services/resourceManagement/lib/models/index.d.ts create mode 100644 lib/services/resourceManagement/lib/models/index.js create mode 100644 lib/services/resourceManagement/lib/models/operation.js create mode 100644 lib/services/resourceManagement/lib/models/operationDisplay.js create mode 100644 lib/services/resourceManagement/lib/models/operationListResult.js create mode 100644 lib/services/resourceManagement/lib/models/plan.js create mode 100644 lib/services/resourceManagement/lib/models/planPatchable.js create mode 100644 lib/services/resourceManagement/lib/models/resource.js create mode 100644 lib/services/resourceManagement/lib/models/sku.js create mode 100644 lib/services/resourceManagement/lib/operations/applianceDefinitions.js create mode 100644 lib/services/resourceManagement/lib/operations/appliances.js create mode 100644 lib/services/resourceManagement/lib/operations/index.d.ts create mode 100644 lib/services/resourceManagement/lib/operations/index.js create mode 100644 lib/services/resourceManagement/lib/policy/models/identity.js create mode 100644 lib/services/resourceManagement/lib/resource/models/identityUserAssignedIdentitiesValue.js create mode 100644 lib/services/resourceManagement/lib/resource/models/onErrorDeployment.js create mode 100644 lib/services/resourceManagement/lib/resource/models/onErrorDeploymentExtended.js create mode 100644 lib/services/resourceManagement/lib/resource/models/operation.js create mode 100644 lib/services/resourceManagement/lib/resource/models/operationDisplay.js create mode 100644 lib/services/resourceManagement/lib/resource/models/operationListResult.js create mode 100644 lib/services/resourceManagement/lib/resource/operations/operations.js create mode 100644 lib/services/resourceManagement/lib/subscription/models/operation.js create mode 100644 lib/services/resourceManagement/lib/subscription/models/operationDisplay.js create mode 100644 lib/services/resourceManagement/lib/subscription/models/operationListResult.js create mode 100644 lib/services/resourceManagement/lib/subscription/operations/operations.js create mode 100644 lib/services/serviceBusManagement2/lib/models/migrationConfigListResult.js create mode 100644 lib/services/serviceBusManagement2/lib/models/migrationConfigProperties.js create mode 100644 lib/services/serviceBusManagement2/lib/operations/migrationConfigs.js create mode 100644 lib/services/trafficManagerManagement2/lib/models/endpointPropertiesCustomHeadersItem.js create mode 100644 lib/services/trafficManagerManagement2/lib/models/endpointPropertiesSubnetsItem.js create mode 100644 lib/services/trafficManagerManagement2/lib/models/monitorConfigCustomHeadersItem.js create mode 100644 lib/services/trafficManagerManagement2/lib/models/monitorConfigExpectedStatusCodeRangesItem.js create mode 100644 lib/services/trafficManagerManagement2/lib/models/userMetricsModel.js create mode 100644 lib/services/websiteManagement2/LICENSE.txt create mode 100644 lib/services/websiteManagement2/README.md create mode 100644 lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js create mode 100644 lib/services/websiteManagement2/lib/models/address.js create mode 100644 lib/services/websiteManagement2/lib/models/addressResponse.js create mode 100644 lib/services/websiteManagement2/lib/models/analysisData.js create mode 100644 lib/services/websiteManagement2/lib/models/analysisDefinition.js create mode 100644 lib/services/websiteManagement2/lib/models/apiDefinitionInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceCertificate.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceCertificateCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceCertificateOrder.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceCertificateOrderCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceCertificateOrderPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceCertificatePatchResource.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceCertificateResource.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceEnvironment.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceEnvironmentCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js create mode 100644 lib/services/websiteManagement2/lib/models/appServicePlan.js create mode 100644 lib/services/websiteManagement2/lib/models/appServicePlanCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/models/applicationLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/applicationStack.js create mode 100644 lib/services/websiteManagement2/lib/models/applicationStackCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/autoHealActions.js create mode 100644 lib/services/websiteManagement2/lib/models/autoHealCustomAction.js create mode 100644 lib/services/websiteManagement2/lib/models/autoHealRules.js create mode 100644 lib/services/websiteManagement2/lib/models/autoHealTriggers.js create mode 100644 lib/services/websiteManagement2/lib/models/azureBlobStorageApplicationLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/azureBlobStorageHttpLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/azureStorageInfoValue.js create mode 100644 lib/services/websiteManagement2/lib/models/azureStoragePropertyDictionaryResource.js create mode 100644 lib/services/websiteManagement2/lib/models/azureTableStorageApplicationLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/backupItem.js create mode 100644 lib/services/websiteManagement2/lib/models/backupItemCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/backupRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/backupSchedule.js create mode 100644 lib/services/websiteManagement2/lib/models/billingMeter.js create mode 100644 lib/services/websiteManagement2/lib/models/billingMeterCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/capability.js create mode 100644 lib/services/websiteManagement2/lib/models/certificate.js create mode 100644 lib/services/websiteManagement2/lib/models/certificateCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/certificateDetails.js create mode 100644 lib/services/websiteManagement2/lib/models/certificateEmail.js create mode 100644 lib/services/websiteManagement2/lib/models/certificateOrderAction.js create mode 100644 lib/services/websiteManagement2/lib/models/certificatePatchResource.js create mode 100644 lib/services/websiteManagement2/lib/models/cloningInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/connStringInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/connStringValueTypePair.js create mode 100644 lib/services/websiteManagement2/lib/models/connectionStringDictionary.js create mode 100644 lib/services/websiteManagement2/lib/models/contact.js create mode 100644 lib/services/websiteManagement2/lib/models/continuousWebJob.js create mode 100644 lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/corsSettings.js create mode 100644 lib/services/websiteManagement2/lib/models/csmMoveResourceEnvelope.js create mode 100644 lib/services/websiteManagement2/lib/models/csmOperationCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/csmOperationDescription.js create mode 100644 lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js create mode 100644 lib/services/websiteManagement2/lib/models/csmOperationDisplay.js create mode 100644 lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.js create mode 100644 lib/services/websiteManagement2/lib/models/csmSlotEntity.js create mode 100644 lib/services/websiteManagement2/lib/models/csmUsageQuota.js create mode 100644 lib/services/websiteManagement2/lib/models/csmUsageQuotaCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/customHostnameAnalysisResult.js create mode 100644 lib/services/websiteManagement2/lib/models/dataSource.js create mode 100644 lib/services/websiteManagement2/lib/models/dataTableResponseColumn.js create mode 100644 lib/services/websiteManagement2/lib/models/dataTableResponseObject.js create mode 100644 lib/services/websiteManagement2/lib/models/databaseBackupSetting.js create mode 100644 lib/services/websiteManagement2/lib/models/defaultErrorResponse.js create mode 100644 lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js create mode 100644 lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js create mode 100644 lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/deletedSite.js create mode 100644 lib/services/websiteManagement2/lib/models/deletedWebAppCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/deployment.js create mode 100644 lib/services/websiteManagement2/lib/models/deploymentCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/deploymentLocations.js create mode 100644 lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js create mode 100644 lib/services/websiteManagement2/lib/models/detectorDefinition.js create mode 100644 lib/services/websiteManagement2/lib/models/detectorInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/detectorResponse.js create mode 100644 lib/services/websiteManagement2/lib/models/detectorResponseCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticAnalysis.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticAnalysisCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticCategory.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticCategoryCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticData.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticDetectorCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticDetectorResponse.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticMetricSample.js create mode 100644 lib/services/websiteManagement2/lib/models/diagnosticMetricSet.js create mode 100644 lib/services/websiteManagement2/lib/models/dimension.js create mode 100644 lib/services/websiteManagement2/lib/models/domain.js create mode 100644 lib/services/websiteManagement2/lib/models/domainAvailablilityCheckResult.js create mode 100644 lib/services/websiteManagement2/lib/models/domainCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/domainControlCenterSsoRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/domainOwnershipIdentifier.js create mode 100644 lib/services/websiteManagement2/lib/models/domainOwnershipIdentifierCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/domainPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/models/domainPurchaseConsent.js create mode 100644 lib/services/websiteManagement2/lib/models/domainRecommendationSearchParameters.js create mode 100644 lib/services/websiteManagement2/lib/models/enabledConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/errorEntity.js create mode 100644 lib/services/websiteManagement2/lib/models/experiments.js create mode 100644 lib/services/websiteManagement2/lib/models/fileSystemApplicationLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/fileSystemHttpLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/functionEnvelope.js create mode 100644 lib/services/websiteManagement2/lib/models/functionEnvelopeCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/functionSecrets.js create mode 100644 lib/services/websiteManagement2/lib/models/geoRegion.js create mode 100644 lib/services/websiteManagement2/lib/models/geoRegionCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.js create mode 100644 lib/services/websiteManagement2/lib/models/handlerMapping.js create mode 100644 lib/services/websiteManagement2/lib/models/hostName.js create mode 100644 lib/services/websiteManagement2/lib/models/hostNameBinding.js create mode 100644 lib/services/websiteManagement2/lib/models/hostNameBindingCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/hostNameSslState.js create mode 100644 lib/services/websiteManagement2/lib/models/hostingEnvironmentDeploymentInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/hostingEnvironmentDiagnostics.js create mode 100644 lib/services/websiteManagement2/lib/models/hostingEnvironmentProfile.js create mode 100644 lib/services/websiteManagement2/lib/models/httpLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/hybridConnection.js create mode 100644 lib/services/websiteManagement2/lib/models/hybridConnectionCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/hybridConnectionKey.js create mode 100644 lib/services/websiteManagement2/lib/models/hybridConnectionLimits.js create mode 100644 lib/services/websiteManagement2/lib/models/identifier.js create mode 100644 lib/services/websiteManagement2/lib/models/identifierCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/index.d.ts create mode 100644 lib/services/websiteManagement2/lib/models/index.js create mode 100644 lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js create mode 100644 lib/services/websiteManagement2/lib/models/localizableString.js create mode 100644 lib/services/websiteManagement2/lib/models/logSpecification.js create mode 100644 lib/services/websiteManagement2/lib/models/mSDeploy.js create mode 100644 lib/services/websiteManagement2/lib/models/mSDeployLog.js create mode 100644 lib/services/websiteManagement2/lib/models/mSDeployLogEntry.js create mode 100644 lib/services/websiteManagement2/lib/models/mSDeployStatus.js create mode 100644 lib/services/websiteManagement2/lib/models/managedServiceIdentity.js create mode 100644 lib/services/websiteManagement2/lib/models/metricAvailabilily.js create mode 100644 lib/services/websiteManagement2/lib/models/metricAvailability.js create mode 100644 lib/services/websiteManagement2/lib/models/metricDefinition.js create mode 100644 lib/services/websiteManagement2/lib/models/metricSpecification.js create mode 100644 lib/services/websiteManagement2/lib/models/migrateMySqlRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/migrateMySqlStatus.js create mode 100644 lib/services/websiteManagement2/lib/models/nameIdentifier.js create mode 100644 lib/services/websiteManagement2/lib/models/nameIdentifierCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/nameValuePair.js create mode 100644 lib/services/websiteManagement2/lib/models/networkAccessControlEntry.js create mode 100644 lib/services/websiteManagement2/lib/models/networkFeatures.js create mode 100644 lib/services/websiteManagement2/lib/models/networkTrace.js create mode 100644 lib/services/websiteManagement2/lib/models/operation.js create mode 100644 lib/services/websiteManagement2/lib/models/perfMonCounterCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/perfMonResponse.js create mode 100644 lib/services/websiteManagement2/lib/models/perfMonSample.js create mode 100644 lib/services/websiteManagement2/lib/models/perfMonSet.js create mode 100644 lib/services/websiteManagement2/lib/models/premierAddOn.js create mode 100644 lib/services/websiteManagement2/lib/models/premierAddOnOffer.js create mode 100644 lib/services/websiteManagement2/lib/models/premierAddOnOfferCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/premierAddOnPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/models/privateAccess.js create mode 100644 lib/services/websiteManagement2/lib/models/privateAccessSubnet.js create mode 100644 lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js create mode 100644 lib/services/websiteManagement2/lib/models/processInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/processInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/processModuleInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/processModuleInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/processThreadInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/processThreadInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/proxyOnlyResource.js create mode 100644 lib/services/websiteManagement2/lib/models/publicCertificate.js create mode 100644 lib/services/websiteManagement2/lib/models/publicCertificateCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/pushSettings.js create mode 100644 lib/services/websiteManagement2/lib/models/rampUpRule.js create mode 100644 lib/services/websiteManagement2/lib/models/recommendation.js create mode 100644 lib/services/websiteManagement2/lib/models/recommendationCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/recommendationRule.js create mode 100644 lib/services/websiteManagement2/lib/models/reissueCertificateOrderRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/relayServiceConnectionEntity.js create mode 100644 lib/services/websiteManagement2/lib/models/rendering.js create mode 100644 lib/services/websiteManagement2/lib/models/renewCertificateOrderRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/requestsBasedTrigger.js create mode 100644 lib/services/websiteManagement2/lib/models/resource.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceHealthMetadata.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceHealthMetadataCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceMetric.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceMetricAvailability.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceMetricCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceMetricDefinitionCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceMetricName.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceMetricProperty.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceMetricValue.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceNameAvailability.js create mode 100644 lib/services/websiteManagement2/lib/models/resourceNameAvailabilityRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/responseMetaData.js create mode 100644 lib/services/websiteManagement2/lib/models/restoreRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/serviceSpecification.js create mode 100644 lib/services/websiteManagement2/lib/models/site.js create mode 100644 lib/services/websiteManagement2/lib/models/siteAuthSettings.js create mode 100644 lib/services/websiteManagement2/lib/models/siteCloneability.js create mode 100644 lib/services/websiteManagement2/lib/models/siteCloneabilityCriterion.js create mode 100644 lib/services/websiteManagement2/lib/models/siteConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/siteConfigResource.js create mode 100644 lib/services/websiteManagement2/lib/models/siteConfigResourceCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/siteExtensionInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/siteExtensionInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/siteInstance.js create mode 100644 lib/services/websiteManagement2/lib/models/siteLimits.js create mode 100644 lib/services/websiteManagement2/lib/models/siteLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/models/siteMachineKey.js create mode 100644 lib/services/websiteManagement2/lib/models/sitePatchResource.js create mode 100644 lib/services/websiteManagement2/lib/models/sitePhpErrorLogFlag.js create mode 100644 lib/services/websiteManagement2/lib/models/siteSeal.js create mode 100644 lib/services/websiteManagement2/lib/models/siteSealRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/siteSourceControl.js create mode 100644 lib/services/websiteManagement2/lib/models/skuCapacity.js create mode 100644 lib/services/websiteManagement2/lib/models/skuDescription.js create mode 100644 lib/services/websiteManagement2/lib/models/skuInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/skuInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/skuInfos.js create mode 100644 lib/services/websiteManagement2/lib/models/slotConfigNamesResource.js create mode 100644 lib/services/websiteManagement2/lib/models/slotDifference.js create mode 100644 lib/services/websiteManagement2/lib/models/slotDifferenceCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/slotSwapStatus.js create mode 100644 lib/services/websiteManagement2/lib/models/slowRequestsBasedTrigger.js create mode 100644 lib/services/websiteManagement2/lib/models/snapshot.js create mode 100644 lib/services/websiteManagement2/lib/models/snapshotCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/snapshotRecoverySource.js create mode 100644 lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/solution.js create mode 100644 lib/services/websiteManagement2/lib/models/sourceControl.js create mode 100644 lib/services/websiteManagement2/lib/models/sourceControlCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/stackMajorVersion.js create mode 100644 lib/services/websiteManagement2/lib/models/stackMinorVersion.js create mode 100644 lib/services/websiteManagement2/lib/models/stampCapacity.js create mode 100644 lib/services/websiteManagement2/lib/models/stampCapacityCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/statusCodesBasedTrigger.js create mode 100644 lib/services/websiteManagement2/lib/models/storageMigrationOptions.js create mode 100644 lib/services/websiteManagement2/lib/models/storageMigrationResponse.js create mode 100644 lib/services/websiteManagement2/lib/models/stringDictionary.js create mode 100644 lib/services/websiteManagement2/lib/models/swiftVirtualNetwork.js create mode 100644 lib/services/websiteManagement2/lib/models/tldLegalAgreement.js create mode 100644 lib/services/websiteManagement2/lib/models/tldLegalAgreementCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/topLevelDomain.js create mode 100644 lib/services/websiteManagement2/lib/models/topLevelDomainAgreementOption.js create mode 100644 lib/services/websiteManagement2/lib/models/topLevelDomainCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/triggeredJobHistory.js create mode 100644 lib/services/websiteManagement2/lib/models/triggeredJobHistoryCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/triggeredJobRun.js create mode 100644 lib/services/websiteManagement2/lib/models/triggeredWebJob.js create mode 100644 lib/services/websiteManagement2/lib/models/triggeredWebJobCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/usage.js create mode 100644 lib/services/websiteManagement2/lib/models/usageCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/user.js create mode 100644 lib/services/websiteManagement2/lib/models/validateRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/validateResponse.js create mode 100644 lib/services/websiteManagement2/lib/models/validateResponseError.js create mode 100644 lib/services/websiteManagement2/lib/models/virtualApplication.js create mode 100644 lib/services/websiteManagement2/lib/models/virtualDirectory.js create mode 100644 lib/services/websiteManagement2/lib/models/virtualIPMapping.js create mode 100644 lib/services/websiteManagement2/lib/models/virtualNetworkProfile.js create mode 100644 lib/services/websiteManagement2/lib/models/vnetGateway.js create mode 100644 lib/services/websiteManagement2/lib/models/vnetInfo.js create mode 100644 lib/services/websiteManagement2/lib/models/vnetParameters.js create mode 100644 lib/services/websiteManagement2/lib/models/vnetRoute.js create mode 100644 lib/services/websiteManagement2/lib/models/vnetValidationFailureDetails.js create mode 100644 lib/services/websiteManagement2/lib/models/vnetValidationTestFailure.js create mode 100644 lib/services/websiteManagement2/lib/models/webAppCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/webAppInstanceCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/webJob.js create mode 100644 lib/services/websiteManagement2/lib/models/webJobCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/workerPool.js create mode 100644 lib/services/websiteManagement2/lib/models/workerPoolCollection.js create mode 100644 lib/services/websiteManagement2/lib/models/workerPoolResource.js create mode 100644 lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js create mode 100644 lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js create mode 100644 lib/services/websiteManagement2/lib/operations/appServicePlans.js create mode 100644 lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js create mode 100644 lib/services/websiteManagement2/lib/operations/certificates.js create mode 100644 lib/services/websiteManagement2/lib/operations/deletedWebApps.js create mode 100644 lib/services/websiteManagement2/lib/operations/diagnostics.js create mode 100644 lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js create mode 100644 lib/services/websiteManagement2/lib/operations/domains.js create mode 100644 lib/services/websiteManagement2/lib/operations/index.d.ts create mode 100644 lib/services/websiteManagement2/lib/operations/index.js create mode 100644 lib/services/websiteManagement2/lib/operations/provider.js create mode 100644 lib/services/websiteManagement2/lib/operations/recommendations.js create mode 100644 lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js create mode 100644 lib/services/websiteManagement2/lib/operations/topLevelDomains.js create mode 100644 lib/services/websiteManagement2/lib/operations/webApps.js create mode 100644 lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts create mode 100644 lib/services/websiteManagement2/lib/webSiteManagementClient.js create mode 100644 lib/services/websiteManagement2/package.json diff --git a/lib/services/applicationinsights/lib/applicationInsightsManagementClient.d.ts b/lib/services/applicationinsights/lib/applicationInsightsManagementClient.d.ts index 5503502dc0..710c74dd2b 100644 --- a/lib/services/applicationinsights/lib/applicationInsightsManagementClient.d.ts +++ b/lib/services/applicationinsights/lib/applicationInsightsManagementClient.d.ts @@ -34,11 +34,11 @@ export default class ApplicationInsightsManagementClient extends AzureServiceCli * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -68,12 +68,10 @@ export default class ApplicationInsightsManagementClient extends AzureServiceCli components: operations.Components; workItemConfigurations: operations.WorkItemConfigurations; favorites: operations.Favorites; - favorite: operations.Favorite; webTestLocations: operations.WebTestLocations; webTests: operations.WebTests; - analyticsItem: operations.AnalyticsItem; - workbooksOperations: operations.WorkbooksOperations; - workbookOperations: operations.WorkbookOperations; + analyticsItems: operations.AnalyticsItems; + workbooks: operations.Workbooks; } export { ApplicationInsightsManagementClient, models as ApplicationInsightsManagementModels }; diff --git a/lib/services/applicationinsights/lib/applicationInsightsManagementClient.js b/lib/services/applicationinsights/lib/applicationInsightsManagementClient.js index c4599eeba5..71a33ea8e7 100644 --- a/lib/services/applicationinsights/lib/applicationInsightsManagementClient.js +++ b/lib/services/applicationinsights/lib/applicationInsightsManagementClient.js @@ -34,9 +34,9 @@ class ApplicationInsightsManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -84,12 +84,10 @@ class ApplicationInsightsManagementClient extends ServiceClient { this.components = new operations.Components(this); this.workItemConfigurations = new operations.WorkItemConfigurations(this); this.favorites = new operations.Favorites(this); - this.favorite = new operations.Favorite(this); this.webTestLocations = new operations.WebTestLocations(this); this.webTests = new operations.WebTests(this); - this.analyticsItem = new operations.AnalyticsItem(this); - this.workbooksOperations = new operations.WorkbooksOperations(this); - this.workbookOperations = new operations.WorkbookOperations(this); + this.analyticsItems = new operations.AnalyticsItems(this); + this.workbooks = new operations.Workbooks(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/applicationinsights/lib/models/annotationError.js b/lib/services/applicationinsights/lib/models/annotationError.js index 4b9fc68492..2fabbeb868 100644 --- a/lib/services/applicationinsights/lib/models/annotationError.js +++ b/lib/services/applicationinsights/lib/models/annotationError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Error associated with trying to create annotation with Id that already exist * diff --git a/lib/services/applicationinsights/lib/models/annotationsListResult.js b/lib/services/applicationinsights/lib/models/annotationsListResult.js new file mode 100644 index 0000000000..89f89db324 --- /dev/null +++ b/lib/services/applicationinsights/lib/models/annotationsListResult.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Annotations list result. + */ +class AnnotationsListResult extends Array { + /** + * Create a AnnotationsListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AnnotationsListResult + * + * @returns {object} metadata of AnnotationsListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AnnotationsListResult', + type: { + name: 'Composite', + className: 'AnnotationsListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AnnotationElementType', + type: { + name: 'Composite', + className: 'Annotation' + } + } + } + } + } + } + }; + } +} + +module.exports = AnnotationsListResult; diff --git a/lib/services/applicationinsights/lib/models/applicationInsightsComponentAnalyticsItem.js b/lib/services/applicationinsights/lib/models/applicationInsightsComponentAnalyticsItem.js index 8722f17c8a..a27d549698 100644 --- a/lib/services/applicationinsights/lib/models/applicationInsightsComponentAnalyticsItem.js +++ b/lib/services/applicationinsights/lib/models/applicationInsightsComponentAnalyticsItem.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Properties that define an Analytics item that is associated to an * Application Insights component. diff --git a/lib/services/applicationinsights/lib/models/applicationInsightsComponentAvailableFeatures.js b/lib/services/applicationinsights/lib/models/applicationInsightsComponentAvailableFeatures.js index 8867f4e048..42b2c32ea3 100644 --- a/lib/services/applicationinsights/lib/models/applicationInsightsComponentAvailableFeatures.js +++ b/lib/services/applicationinsights/lib/models/applicationInsightsComponentAvailableFeatures.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An Application Insights component available features. * diff --git a/lib/services/applicationinsights/lib/models/applicationInsightsComponentBillingFeatures.js b/lib/services/applicationinsights/lib/models/applicationInsightsComponentBillingFeatures.js index f7a4157280..276983d914 100644 --- a/lib/services/applicationinsights/lib/models/applicationInsightsComponentBillingFeatures.js +++ b/lib/services/applicationinsights/lib/models/applicationInsightsComponentBillingFeatures.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An Application Insights component billing features * diff --git a/lib/services/applicationinsights/lib/models/applicationInsightsComponentFeature.js b/lib/services/applicationinsights/lib/models/applicationInsightsComponentFeature.js index e7fbc07c23..936d2dc84e 100644 --- a/lib/services/applicationinsights/lib/models/applicationInsightsComponentFeature.js +++ b/lib/services/applicationinsights/lib/models/applicationInsightsComponentFeature.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An Application Insights component daily data volume cap status * diff --git a/lib/services/applicationinsights/lib/models/componentPurgeBody.js b/lib/services/applicationinsights/lib/models/componentPurgeBody.js index 14b09d26d4..25077567a9 100644 --- a/lib/services/applicationinsights/lib/models/componentPurgeBody.js +++ b/lib/services/applicationinsights/lib/models/componentPurgeBody.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes the body of a purge request for an App Insights component * diff --git a/lib/services/applicationinsights/lib/models/index.d.ts b/lib/services/applicationinsights/lib/models/index.d.ts index 4709787126..2e33a87dc4 100644 --- a/lib/services/applicationinsights/lib/models/index.d.ts +++ b/lib/services/applicationinsights/lib/models/index.d.ts @@ -1015,18 +1015,6 @@ export interface Workbook extends WorkbookResource { sourceResourceId?: string; } -/** - * @class - * Initializes a new instance of the Workbooks class. - * @constructor - * Workbook list result. - * - * @member {array} [value] An array of workbooks. - */ -export interface Workbooks { - value?: Workbook[]; -} - /** * @class * Initializes a new instance of the LinkProperties class. @@ -1093,6 +1081,16 @@ export interface OperationListResult extends Array { nextLink?: string; } +/** + * @class + * Initializes a new instance of the AnnotationsListResult class. + * @constructor + * Annotations list result. + * + */ +export interface AnnotationsListResult extends Array { +} + /** * @class * Initializes a new instance of the ApplicationInsightsComponentAPIKeyListResult class. @@ -1117,6 +1115,16 @@ export interface ApplicationInsightsComponentListResult extends Array { +} + /** * @class * Initializes a new instance of the ApplicationInsightsWebTestLocationsListResult class. @@ -1141,3 +1149,13 @@ export interface ApplicationInsightsWebTestLocationsListResult extends Array { nextLink?: string; } + +/** + * @class + * Initializes a new instance of the WorkbooksListResult class. + * @constructor + * Workbook list result. + * + */ +export interface WorkbooksListResult extends Array { +} diff --git a/lib/services/applicationinsights/lib/models/index.js b/lib/services/applicationinsights/lib/models/index.js index 47cebc05d9..155639f1bd 100644 --- a/lib/services/applicationinsights/lib/models/index.js +++ b/lib/services/applicationinsights/lib/models/index.js @@ -57,12 +57,14 @@ exports.ApplicationInsightsComponentAnalyticsItemProperties = require('./applica exports.ApplicationInsightsComponentAnalyticsItem = require('./applicationInsightsComponentAnalyticsItem'); exports.WorkbookResource = require('./workbookResource'); exports.Workbook = require('./workbook'); -exports.Workbooks = require('./workbooks'); exports.LinkProperties = require('./linkProperties'); exports.ErrorFieldContract = require('./errorFieldContract'); exports.WorkbookError = require('./workbookError'); exports.OperationListResult = require('./operationListResult'); +exports.AnnotationsListResult = require('./annotationsListResult'); exports.ApplicationInsightsComponentAPIKeyListResult = require('./applicationInsightsComponentAPIKeyListResult'); exports.ApplicationInsightsComponentListResult = require('./applicationInsightsComponentListResult'); +exports.WorkItemConfigurationsListResult = require('./workItemConfigurationsListResult'); exports.ApplicationInsightsWebTestLocationsListResult = require('./applicationInsightsWebTestLocationsListResult'); exports.WebTestListResult = require('./webTestListResult'); +exports.WorkbooksListResult = require('./workbooksListResult'); diff --git a/lib/services/applicationinsights/lib/models/operation.js b/lib/services/applicationinsights/lib/models/operation.js index 6c5b4ed71a..f4fb078601 100644 --- a/lib/services/applicationinsights/lib/models/operation.js +++ b/lib/services/applicationinsights/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * CDN REST API operation * diff --git a/lib/services/applicationinsights/lib/models/workItemConfigurationError.js b/lib/services/applicationinsights/lib/models/workItemConfigurationError.js index 562531bf21..26fde162f5 100644 --- a/lib/services/applicationinsights/lib/models/workItemConfigurationError.js +++ b/lib/services/applicationinsights/lib/models/workItemConfigurationError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Error associated with trying to get work item configuration or * configurations diff --git a/lib/services/applicationinsights/lib/models/workItemConfigurationsListResult.js b/lib/services/applicationinsights/lib/models/workItemConfigurationsListResult.js new file mode 100644 index 0000000000..2bfd00bdb6 --- /dev/null +++ b/lib/services/applicationinsights/lib/models/workItemConfigurationsListResult.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Work item configuration list result. + */ +class WorkItemConfigurationsListResult extends Array { + /** + * Create a WorkItemConfigurationsListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WorkItemConfigurationsListResult + * + * @returns {object} metadata of WorkItemConfigurationsListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'WorkItemConfigurationsListResult', + type: { + name: 'Composite', + className: 'WorkItemConfigurationsListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WorkItemConfigurationElementType', + type: { + name: 'Composite', + className: 'WorkItemConfiguration' + } + } + } + } + } + } + }; + } +} + +module.exports = WorkItemConfigurationsListResult; diff --git a/lib/services/applicationinsights/lib/models/workbookError.js b/lib/services/applicationinsights/lib/models/workbookError.js index f3eee37bda..3b538bc58f 100644 --- a/lib/services/applicationinsights/lib/models/workbookError.js +++ b/lib/services/applicationinsights/lib/models/workbookError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Error message body that will indicate why the operation failed. * diff --git a/lib/services/applicationinsights/lib/models/workbooksListResult.js b/lib/services/applicationinsights/lib/models/workbooksListResult.js new file mode 100644 index 0000000000..46e10a4041 --- /dev/null +++ b/lib/services/applicationinsights/lib/models/workbooksListResult.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Workbook list result. + */ +class WorkbooksListResult extends Array { + /** + * Create a WorkbooksListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WorkbooksListResult + * + * @returns {object} metadata of WorkbooksListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'WorkbooksListResult', + type: { + name: 'Composite', + className: 'WorkbooksListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WorkbookElementType', + type: { + name: 'Composite', + className: 'Workbook' + } + } + } + } + } + } + }; + } +} + +module.exports = WorkbooksListResult; diff --git a/lib/services/applicationinsights/lib/operations/analyticsItems.js b/lib/services/applicationinsights/lib/operations/analyticsItems.js new file mode 100644 index 0000000000..8eb571855d --- /dev/null +++ b/lib/services/applicationinsights/lib/operations/analyticsItems.js @@ -0,0 +1,1280 @@ +/* + * 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; + +/** + * Gets a list of Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.scope] Enum indicating if this item definition is + * owned by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'shared', 'user' + * + * @param {string} [options.type] Enum indicating the type of the Analytics + * item. Possible values include: 'none', 'query', 'function', 'folder', + * 'recent' + * + * @param {boolean} [options.includeContent] Flag indicating whether or not to + * return the content of each applicable item. If false, only return the item + * information. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _list(resourceGroupName, resourceName, scopePath, options, callback) { + /* jshint 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 scope = (options && options.scope !== undefined) ? options.scope : 'shared'; + let type = (options && options.type !== undefined) ? options.type : 'none'; + let includeContent = (options && options.includeContent !== undefined) ? options.includeContent : 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (scopePath === null || scopePath === undefined || typeof scopePath.valueOf() !== 'string') { + throw new Error('scopePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (scope !== null && scope !== undefined && typeof scope.valueOf() !== 'string') { + throw new Error('scope must be of type string.'); + } + if (type !== null && type !== undefined && typeof type.valueOf() !== 'string') { + throw new Error('type must be of type string.'); + } + if (includeContent !== null && includeContent !== undefined && typeof includeContent !== 'boolean') { + throw new Error('includeContent must be of type boolean.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{scopePath}', encodeURIComponent(scopePath)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (scope !== null && scope !== undefined) { + queryParameters.push('scope=' + encodeURIComponent(scope)); + } + if (type !== null && type !== undefined) { + queryParameters.push('type=' + encodeURIComponent(type)); + } + if (includeContent !== null && includeContent !== undefined) { + queryParameters.push('includeContent=' + encodeURIComponent(includeContent.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationInsightsComponentAnalyticsItemElementType', + type: { + name: 'Composite', + className: 'ApplicationInsightsComponentAnalyticsItem' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a specific Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.id] The Id of a specific item defined in the + * Application Insights component + * + * @param {string} [options.name] The name of a specific item defined in the + * Application Insights component + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentAnalyticsItem} + * for more information. + * + * {object} [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, resourceName, scopePath, options, callback) { + /* jshint 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 id = (options && options.id !== undefined) ? options.id : undefined; + 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (scopePath === null || scopePath === undefined || typeof scopePath.valueOf() !== 'string') { + throw new Error('scopePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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 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); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{scopePath}', encodeURIComponent(scopePath)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (id !== null && id !== undefined) { + queryParameters.push('id=' + encodeURIComponent(id)); + } + if (name !== null && name !== undefined) { + queryParameters.push('name=' + encodeURIComponent(name)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationInsightsComponentAnalyticsItem']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Adds or Updates a specific Analytics Item within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} itemProperties Properties that need to be specified to + * create a new item and add it to an Application Insights component. + * + * @param {string} [itemProperties.id] Internally assigned unique id of the + * item definition. + * + * @param {string} [itemProperties.name] The user-defined name of the item. + * + * @param {string} [itemProperties.content] The content of this item + * + * @param {string} [itemProperties.scope] Enum indicating if this item + * definition is owned by a specific user or is shared between all users with + * access to the Application Insights component. Possible values include: + * 'shared', 'user' + * + * @param {string} [itemProperties.type] Enum indicating the type of the + * Analytics item. Possible values include: 'query', 'function', 'folder', + * 'recent' + * + * @param {object} [itemProperties.properties] + * + * @param {string} [itemProperties.properties.functionAlias] A function alias, + * used when the type of the item is Function + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.overrideItem] Flag indicating whether or not to + * force save an item. This allows overriding an item if it already exists. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentAnalyticsItem} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _put(resourceGroupName, resourceName, scopePath, itemProperties, options, callback) { + /* jshint 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 overrideItem = (options && options.overrideItem !== undefined) ? options.overrideItem : 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (scopePath === null || scopePath === undefined || typeof scopePath.valueOf() !== 'string') { + throw new Error('scopePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (overrideItem !== null && overrideItem !== undefined && typeof overrideItem !== 'boolean') { + throw new Error('overrideItem must be of type boolean.'); + } + if (itemProperties === null || itemProperties === undefined) { + throw new Error('itemProperties cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{scopePath}', encodeURIComponent(scopePath)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (overrideItem !== null && overrideItem !== undefined) { + queryParameters.push('overrideItem=' + encodeURIComponent(overrideItem.toString())); + } + 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 (itemProperties !== null && itemProperties !== undefined) { + let requestModelMapper = new client.models['ApplicationInsightsComponentAnalyticsItem']().mapper(); + requestModel = client.serialize(requestModelMapper, itemProperties, 'itemProperties'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(itemProperties, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationInsightsComponentAnalyticsItem']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a specific Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.id] The Id of a specific item defined in the + * Application Insights component + * + * @param {string} [options.name] The name of a specific item defined in the + * Application Insights component + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, resourceName, scopePath, options, callback) { + /* jshint 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 id = (options && options.id !== undefined) ? options.id : undefined; + 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (scopePath === null || scopePath === undefined || typeof scopePath.valueOf() !== 'string') { + throw new Error('scopePath cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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 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); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{scopePath}', encodeURIComponent(scopePath)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (id !== null && id !== undefined) { + queryParameters.push('id=' + encodeURIComponent(id)); + } + if (name !== null && name !== undefined) { + queryParameters.push('name=' + encodeURIComponent(name)); + } + 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); + }); +} + +/** Class representing a AnalyticsItems. */ +class AnalyticsItems { + /** + * Create a AnalyticsItems. + * @param {ApplicationInsightsManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._put = _put; + this._deleteMethod = _deleteMethod; + } + + /** + * Gets a list of Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.scope] Enum indicating if this item definition is + * owned by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'shared', 'user' + * + * @param {string} [options.type] Enum indicating the type of the Analytics + * item. Possible values include: 'none', 'query', 'function', 'folder', + * 'recent' + * + * @param {boolean} [options.includeContent] Flag indicating whether or not to + * return the content of each applicable item. If false, only return the item + * information. + * + * @param {object} [options.customHeaders] Headers 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(resourceGroupName, resourceName, scopePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, resourceName, scopePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.scope] Enum indicating if this item definition is + * owned by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'shared', 'user' + * + * @param {string} [options.type] Enum indicating the type of the Analytics + * item. Possible values include: 'none', 'query', 'function', 'folder', + * 'recent' + * + * @param {boolean} [options.includeContent] Flag indicating whether or not to + * return the content of each applicable item. If false, only return the item + * information. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + list(resourceGroupName, resourceName, scopePath, options, optionalCallback) { + 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(resourceGroupName, resourceName, scopePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, resourceName, scopePath, options, optionalCallback); + } + } + + /** + * Gets a specific Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.id] The Id of a specific item defined in the + * Application Insights component + * + * @param {string} [options.name] The name of a specific item defined in the + * Application Insights component + * + * @param {object} [options.customHeaders] Headers 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, resourceName, scopePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, resourceName, scopePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.id] The Id of a specific item defined in the + * Application Insights component + * + * @param {string} [options.name] The name of a specific item defined in the + * Application Insights component + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationInsightsComponentAnalyticsItem} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentAnalyticsItem} + * for more information. + * + * {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, resourceName, scopePath, options, optionalCallback) { + 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, resourceName, scopePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, resourceName, scopePath, options, optionalCallback); + } + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} itemProperties Properties that need to be specified to + * create a new item and add it to an Application Insights component. + * + * @param {string} [itemProperties.id] Internally assigned unique id of the + * item definition. + * + * @param {string} [itemProperties.name] The user-defined name of the item. + * + * @param {string} [itemProperties.content] The content of this item + * + * @param {string} [itemProperties.scope] Enum indicating if this item + * definition is owned by a specific user or is shared between all users with + * access to the Application Insights component. Possible values include: + * 'shared', 'user' + * + * @param {string} [itemProperties.type] Enum indicating the type of the + * Analytics item. Possible values include: 'query', 'function', 'folder', + * 'recent' + * + * @param {object} [itemProperties.properties] + * + * @param {string} [itemProperties.properties.functionAlias] A function alias, + * used when the type of the item is Function + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.overrideItem] Flag indicating whether or not to + * force save an item. This allows overriding an item if it already exists. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + putWithHttpOperationResponse(resourceGroupName, resourceName, scopePath, itemProperties, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._put(resourceGroupName, resourceName, scopePath, itemProperties, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} itemProperties Properties that need to be specified to + * create a new item and add it to an Application Insights component. + * + * @param {string} [itemProperties.id] Internally assigned unique id of the + * item definition. + * + * @param {string} [itemProperties.name] The user-defined name of the item. + * + * @param {string} [itemProperties.content] The content of this item + * + * @param {string} [itemProperties.scope] Enum indicating if this item + * definition is owned by a specific user or is shared between all users with + * access to the Application Insights component. Possible values include: + * 'shared', 'user' + * + * @param {string} [itemProperties.type] Enum indicating the type of the + * Analytics item. Possible values include: 'query', 'function', 'folder', + * 'recent' + * + * @param {object} [itemProperties.properties] + * + * @param {string} [itemProperties.properties.functionAlias] A function alias, + * used when the type of the item is Function + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.overrideItem] Flag indicating whether or not to + * force save an item. This allows overriding an item if it already exists. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationInsightsComponentAnalyticsItem} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentAnalyticsItem} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + put(resourceGroupName, resourceName, scopePath, itemProperties, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._put(resourceGroupName, resourceName, scopePath, itemProperties, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._put(resourceGroupName, resourceName, scopePath, itemProperties, options, optionalCallback); + } + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.id] The Id of a specific item defined in the + * Application Insights component + * + * @param {string} [options.name] The name of a specific item defined in the + * Application Insights component + * + * @param {object} [options.customHeaders] Headers 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, resourceName, scopePath, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, resourceName, scopePath, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} scopePath Enum indicating if this item definition is owned + * by a specific user or is shared between all users with access to the + * Application Insights component. Possible values include: 'analyticsItems', + * 'myanalyticsItems' + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.id] The Id of a specific item defined in the + * Application Insights component + * + * @param {string} [options.name] The name of a specific item defined in the + * Application Insights component + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, resourceName, scopePath, options, optionalCallback) { + 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, resourceName, scopePath, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, resourceName, scopePath, options, optionalCallback); + } + } + +} + +module.exports = AnalyticsItems; diff --git a/lib/services/applicationinsights/lib/operations/annotations.js b/lib/services/applicationinsights/lib/operations/annotations.js index 9cbbf32d6a..f509e6384b 100644 --- a/lib/services/applicationinsights/lib/operations/annotations.js +++ b/lib/services/applicationinsights/lib/operations/annotations.js @@ -38,7 +38,8 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AnnotationsListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -158,21 +159,7 @@ function _list(resourceGroupName, resourceName, start, end, options, callback) { 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: 'AnnotationElementType', - type: { - name: 'Composite', - className: 'Annotation' - } - } - } - }; + let resultMapper = new client.models['AnnotationsListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -741,7 +728,7 @@ class Annotations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -784,7 +771,7 @@ class Annotations { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {AnnotationsListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -792,7 +779,8 @@ class Annotations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AnnotationsListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/applicationinsights/lib/operations/favorites.js b/lib/services/applicationinsights/lib/operations/favorites.js index b72dd84a07..4ec94eafa3 100644 --- a/lib/services/applicationinsights/lib/operations/favorites.js +++ b/lib/services/applicationinsights/lib/operations/favorites.js @@ -223,56 +223,1146 @@ function _list(resourceGroupName, resourceName, options, callback) { }); } +/** + * Get a single favorite by its FavoriteId, defined within an Application + * Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentFavorite} for + * more information. + * + * {object} [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, resourceName, favoriteId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (favoriteId === null || favoriteId === undefined || typeof favoriteId.valueOf() !== 'string') { + throw new Error('favoriteId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{favoriteId}', encodeURIComponent(favoriteId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationInsightsComponentFavorite']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Adds a new favorites to an Application Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} favoriteProperties Properties that need to be specified to + * create a new favorite and add it to an Application Insights component. + * + * @param {string} [favoriteProperties.name] The user-defined name of the + * favorite. + * + * @param {string} [favoriteProperties.config] Configuration of this particular + * favorite, which are driven by the Azure portal UX. Configuration data is a + * string containing valid JSON + * + * @param {string} [favoriteProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * favorite. Current examples include MetricsExplorer (ME) and Search. + * + * @param {string} [favoriteProperties.favoriteType] Enum indicating if this + * favorite definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'shared', 'user' + * + * @param {string} [favoriteProperties.sourceType] The source of the favorite + * definition. + * + * @param {array} [favoriteProperties.tags] A list of 0 or more tags that are + * associated with this favorite definition + * + * @param {string} [favoriteProperties.category] Favorite category, as defined + * by the user at creation time. + * + * @param {boolean} [favoriteProperties.isGeneratedFromTemplate] Flag denoting + * wether or not this favorite was generated from a template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentFavorite} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _add(resourceGroupName, resourceName, favoriteId, favoriteProperties, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (favoriteId === null || favoriteId === undefined || typeof favoriteId.valueOf() !== 'string') { + throw new Error('favoriteId cannot be null or undefined and it must be of type string.'); + } + if (favoriteProperties === null || favoriteProperties === undefined) { + throw new Error('favoriteProperties cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{favoriteId}', encodeURIComponent(favoriteId)); + let queryParameters = []; + queryParameters.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 (favoriteProperties !== null && favoriteProperties !== undefined) { + let requestModelMapper = new client.models['ApplicationInsightsComponentFavorite']().mapper(); + requestModel = client.serialize(requestModelMapper, favoriteProperties, 'favoriteProperties'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(favoriteProperties, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationInsightsComponentFavorite']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates a favorite that has already been added to an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} favoriteProperties Properties that need to be specified to + * update the existing favorite. + * + * @param {string} [favoriteProperties.name] The user-defined name of the + * favorite. + * + * @param {string} [favoriteProperties.config] Configuration of this particular + * favorite, which are driven by the Azure portal UX. Configuration data is a + * string containing valid JSON + * + * @param {string} [favoriteProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * favorite. Current examples include MetricsExplorer (ME) and Search. + * + * @param {string} [favoriteProperties.favoriteType] Enum indicating if this + * favorite definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'shared', 'user' + * + * @param {string} [favoriteProperties.sourceType] The source of the favorite + * definition. + * + * @param {array} [favoriteProperties.tags] A list of 0 or more tags that are + * associated with this favorite definition + * + * @param {string} [favoriteProperties.category] Favorite category, as defined + * by the user at creation time. + * + * @param {boolean} [favoriteProperties.isGeneratedFromTemplate] Flag denoting + * wether or not this favorite was generated from a template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentFavorite} for + * more information. + * + * {object} [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, resourceName, favoriteId, favoriteProperties, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (favoriteId === null || favoriteId === undefined || typeof favoriteId.valueOf() !== 'string') { + throw new Error('favoriteId cannot be null or undefined and it must be of type string.'); + } + if (favoriteProperties === null || favoriteProperties === undefined) { + throw new Error('favoriteProperties cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{favoriteId}', encodeURIComponent(favoriteId)); + let queryParameters = []; + queryParameters.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 (favoriteProperties !== null && favoriteProperties !== undefined) { + let requestModelMapper = new client.models['ApplicationInsightsComponentFavorite']().mapper(); + requestModel = client.serialize(requestModelMapper, favoriteProperties, 'favoriteProperties'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(favoriteProperties, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationInsightsComponentFavorite']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Remove a favorite that is associated to an Application Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, resourceName, favoriteId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (favoriteId === null || favoriteId === undefined || typeof favoriteId.valueOf() !== 'string') { + throw new Error('favoriteId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{favoriteId}', encodeURIComponent(favoriteId)); + let queryParameters = []; + queryParameters.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); + }); +} + /** Class representing a Favorites. */ class Favorites { /** - * Create a Favorites. - * @param {ApplicationInsightsManagementClient} client Reference to the service client. + * Create a Favorites. + * @param {ApplicationInsightsManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._add = _add; + this._update = _update; + this._deleteMethod = _deleteMethod; + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.favoriteType] The type of favorite. Value can be + * either shared or user. Possible values include: 'shared', 'user' + * + * @param {string} [options.sourceType] Source type of favorite to return. When + * left out, the source type defaults to 'other' (not present in this enum). + * Possible values include: 'retention', 'notebook', 'sessions', 'events', + * 'userflows', 'funnel', 'impact', 'segmentation' + * + * @param {boolean} [options.canFetchContent] Flag indicating whether or not to + * return the full content for each applicable favorite. If false, only return + * summary content for favorites. + * + * @param {array} [options.tags] Tags that must be present on each favorite + * returned. + * + * @param {object} [options.customHeaders] Headers 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(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.favoriteType] The type of favorite. Value can be + * either shared or user. Possible values include: 'shared', 'user' + * + * @param {string} [options.sourceType] Source type of favorite to return. When + * left out, the source type defaults to 'other' (not present in this enum). + * Possible values include: 'retention', 'notebook', 'sessions', 'events', + * 'userflows', 'funnel', 'impact', 'segmentation' + * + * @param {boolean} [options.canFetchContent] Flag indicating whether or not to + * return the full content for each applicable favorite. If false, only return + * summary content for favorites. + * + * @param {array} [options.tags] Tags that must be present on each favorite + * returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + list(resourceGroupName, resourceName, options, optionalCallback) { + 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(resourceGroupName, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, resourceName, options, optionalCallback); + } + } + + /** + * Get a single favorite by its FavoriteId, defined within an Application + * Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, resourceName, favoriteId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, resourceName, favoriteId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get a single favorite by its FavoriteId, defined within an Application + * Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationInsightsComponentFavorite} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentFavorite} for + * more information. + * + * {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, resourceName, favoriteId, options, optionalCallback) { + 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, resourceName, favoriteId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, resourceName, favoriteId, options, optionalCallback); + } + } + + /** + * Adds a new favorites to an Application Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} favoriteProperties Properties that need to be specified to + * create a new favorite and add it to an Application Insights component. + * + * @param {string} [favoriteProperties.name] The user-defined name of the + * favorite. + * + * @param {string} [favoriteProperties.config] Configuration of this particular + * favorite, which are driven by the Azure portal UX. Configuration data is a + * string containing valid JSON + * + * @param {string} [favoriteProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * favorite. Current examples include MetricsExplorer (ME) and Search. + * + * @param {string} [favoriteProperties.favoriteType] Enum indicating if this + * favorite definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'shared', 'user' + * + * @param {string} [favoriteProperties.sourceType] The source of the favorite + * definition. + * + * @param {array} [favoriteProperties.tags] A list of 0 or more tags that are + * associated with this favorite definition + * + * @param {string} [favoriteProperties.category] Favorite category, as defined + * by the user at creation time. + * + * @param {boolean} [favoriteProperties.isGeneratedFromTemplate] Flag denoting + * wether or not this favorite was generated from a template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. */ - constructor(client) { - this.client = client; - this._list = _list; + addWithHttpOperationResponse(resourceGroupName, resourceName, favoriteId, favoriteProperties, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._add(resourceGroupName, resourceName, favoriteId, favoriteProperties, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); } /** - * Gets a list of favorites defined within an Application Insights component. + * Adds a new favorites to an Application Insights component. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} resourceName The name of the Application Insights component * resource. * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} favoriteProperties Properties that need to be specified to + * create a new favorite and add it to an Application Insights component. + * + * @param {string} [favoriteProperties.name] The user-defined name of the + * favorite. + * + * @param {string} [favoriteProperties.config] Configuration of this particular + * favorite, which are driven by the Azure portal UX. Configuration data is a + * string containing valid JSON + * + * @param {string} [favoriteProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * favorite. Current examples include MetricsExplorer (ME) and Search. + * + * @param {string} [favoriteProperties.favoriteType] Enum indicating if this + * favorite definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'shared', 'user' + * + * @param {string} [favoriteProperties.sourceType] The source of the favorite + * definition. + * + * @param {array} [favoriteProperties.tags] A list of 0 or more tags that are + * associated with this favorite definition + * + * @param {string} [favoriteProperties.category] Favorite category, as defined + * by the user at creation time. + * + * @param {boolean} [favoriteProperties.isGeneratedFromTemplate] Flag denoting + * wether or not this favorite was generated from a template. + * * @param {object} [options] Optional Parameters. * - * @param {string} [options.favoriteType] The type of favorite. Value can be - * either shared or user. Possible values include: 'shared', 'user' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [options.sourceType] Source type of favorite to return. When - * left out, the source type defaults to 'other' (not present in this enum). - * Possible values include: 'retention', 'notebook', 'sessions', 'events', - * 'userflows', 'funnel', 'impact', 'segmentation' + * @param {function} [optionalCallback] - The optional callback. * - * @param {boolean} [options.canFetchContent] Flag indicating whether or not to - * return the full content for each applicable favorite. If false, only return - * summary content for favorites. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {array} [options.tags] Tags that must be present on each favorite - * returned. + * {Promise} A promise is returned + * + * @resolve {ApplicationInsightsComponentFavorite} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentFavorite} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + add(resourceGroupName, resourceName, favoriteId, favoriteProperties, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._add(resourceGroupName, resourceName, favoriteId, favoriteProperties, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._add(resourceGroupName, resourceName, favoriteId, favoriteProperties, options, optionalCallback); + } + } + + /** + * Updates a favorite that has already been added to an Application Insights + * component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} favoriteProperties Properties that need to be specified to + * update the existing favorite. + * + * @param {string} [favoriteProperties.name] The user-defined name of the + * favorite. + * + * @param {string} [favoriteProperties.config] Configuration of this particular + * favorite, which are driven by the Azure portal UX. Configuration data is a + * string containing valid JSON + * + * @param {string} [favoriteProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * favorite. Current examples include MetricsExplorer (ME) and Search. + * + * @param {string} [favoriteProperties.favoriteType] Enum indicating if this + * favorite definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'shared', 'user' + * + * @param {string} [favoriteProperties.sourceType] The source of the favorite + * definition. + * + * @param {array} [favoriteProperties.tags] A list of 0 or more tags that are + * associated with this favorite definition + * + * @param {string} [favoriteProperties.category] Favorite category, as defined + * by the user at creation time. + * + * @param {boolean} [favoriteProperties.isGeneratedFromTemplate] Flag denoting + * wether or not this favorite was generated from a template. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listWithHttpOperationResponse(resourceGroupName, resourceName, options) { + updateWithHttpOperationResponse(resourceGroupName, resourceName, favoriteId, favoriteProperties, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._list(resourceGroupName, resourceName, options, (err, result, request, response) => { + self._update(resourceGroupName, resourceName, favoriteId, favoriteProperties, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -283,29 +1373,144 @@ class Favorites { } /** - * Gets a list of favorites defined within an Application Insights component. + * Updates a favorite that has already been added to an Application Insights + * component. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} resourceName The name of the Application Insights component * resource. * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} favoriteProperties Properties that need to be specified to + * update the existing favorite. + * + * @param {string} [favoriteProperties.name] The user-defined name of the + * favorite. + * + * @param {string} [favoriteProperties.config] Configuration of this particular + * favorite, which are driven by the Azure portal UX. Configuration data is a + * string containing valid JSON + * + * @param {string} [favoriteProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * favorite. Current examples include MetricsExplorer (ME) and Search. + * + * @param {string} [favoriteProperties.favoriteType] Enum indicating if this + * favorite definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'shared', 'user' + * + * @param {string} [favoriteProperties.sourceType] The source of the favorite + * definition. + * + * @param {array} [favoriteProperties.tags] A list of 0 or more tags that are + * associated with this favorite definition + * + * @param {string} [favoriteProperties.category] Favorite category, as defined + * by the user at creation time. + * + * @param {boolean} [favoriteProperties.isGeneratedFromTemplate] Flag denoting + * wether or not this favorite was generated from a template. + * * @param {object} [options] Optional Parameters. * - * @param {string} [options.favoriteType] The type of favorite. Value can be - * either shared or user. Possible values include: 'shared', 'user' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [options.sourceType] Source type of favorite to return. When - * left out, the source type defaults to 'other' (not present in this enum). - * Possible values include: 'retention', 'notebook', 'sessions', 'events', - * 'userflows', 'funnel', 'impact', 'segmentation' + * @param {function} [optionalCallback] - The optional callback. * - * @param {boolean} [options.canFetchContent] Flag indicating whether or not to - * return the full content for each applicable favorite. If false, only return - * summary content for favorites. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {array} [options.tags] Tags that must be present on each favorite - * returned. + * {Promise} A promise is returned + * + * @resolve {ApplicationInsightsComponentFavorite} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationInsightsComponentFavorite} for + * more information. + * + * {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, resourceName, favoriteId, favoriteProperties, options, optionalCallback) { + 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, resourceName, favoriteId, favoriteProperties, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, resourceName, favoriteId, favoriteProperties, options, optionalCallback); + } + } + + /** + * Remove a favorite that is associated to an Application Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, resourceName, favoriteId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, resourceName, favoriteId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Remove a favorite that is associated to an Application Insights component. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {string} favoriteId The Id of a specific favorite defined in the + * Application Insights component + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -317,7 +1522,7 @@ class Favorites { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -325,13 +1530,13 @@ class Favorites { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {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. */ - list(resourceGroupName, resourceName, options, optionalCallback) { + deleteMethod(resourceGroupName, resourceName, favoriteId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -340,14 +1545,14 @@ class Favorites { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(resourceGroupName, resourceName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, resourceName, favoriteId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._list(resourceGroupName, resourceName, options, optionalCallback); + return self._deleteMethod(resourceGroupName, resourceName, favoriteId, options, optionalCallback); } } diff --git a/lib/services/applicationinsights/lib/operations/index.d.ts b/lib/services/applicationinsights/lib/operations/index.d.ts index 85da99467c..c8e8333e40 100644 --- a/lib/services/applicationinsights/lib/operations/index.d.ts +++ b/lib/services/applicationinsights/lib/operations/index.d.ts @@ -158,11 +158,11 @@ export interface Annotations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, resourceName: string, start: string, end: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, resourceName: string, start: string, end: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the list of annotations for a component for given time range @@ -189,7 +189,7 @@ export interface Annotations { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {AnnotationsListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -197,15 +197,16 @@ export interface Annotations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {AnnotationsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AnnotationsListResult} for more information. * * {WebResource} [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(resourceGroupName: string, resourceName: string, start: string, end: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, resourceName: string, start: string, end: string, callback: ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, start: string, end: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, resourceName: string, start: string, end: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, resourceName: string, start: string, end: string, callback: ServiceCallback): void; + list(resourceGroupName: string, resourceName: string, start: string, end: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -2630,11 +2631,11 @@ export interface WorkItemConfigurations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the list work item configurations that exist for the application @@ -2656,7 +2657,7 @@ export interface WorkItemConfigurations { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {WorkItemConfigurationsListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2664,15 +2665,17 @@ export interface WorkItemConfigurations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {WorkItemConfigurationsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WorkItemConfigurationsListResult} for more + * information. * * {WebResource} [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(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, resourceName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, resourceName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -2994,15 +2997,6 @@ export interface Favorites { list(resourceGroupName: string, resourceName: string, options?: { favoriteType? : string, sourceType? : string, canFetchContent? : boolean, tags? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; list(resourceGroupName: string, resourceName: string, callback: ServiceCallback): void; list(resourceGroupName: string, resourceName: string, options: { favoriteType? : string, sourceType? : string, canFetchContent? : boolean, tags? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Favorite - * __NOTE__: An instance of this class is automatically created for an - * instance of the ApplicationInsightsManagementClient. - */ -export interface Favorite { /** @@ -4179,11 +4173,11 @@ export interface WebTests { /** * @class - * AnalyticsItem + * AnalyticsItems * __NOTE__: An instance of this class is automatically created for an * instance of the ApplicationInsightsManagementClient. */ -export interface AnalyticsItem { +export interface AnalyticsItems { /** @@ -4582,11 +4576,11 @@ export interface AnalyticsItem { /** * @class - * WorkbooksOperations + * Workbooks * __NOTE__: An instance of this class is automatically created for an * instance of the ApplicationInsightsManagementClient. */ -export interface WorkbooksOperations { +export interface Workbooks { /** @@ -4610,11 +4604,11 @@ export interface WorkbooksOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, category: string, options?: { tags? : string[], canFetchContent? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, category: string, options?: { tags? : string[], canFetchContent? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Get all Workbooks defined within a specified resource group and category. @@ -4642,7 +4636,7 @@ export interface WorkbooksOperations { * * {Promise} A promise is returned. * - * @resolve {Workbooks} - The deserialized result object. + * @resolve {WorkbooksListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4650,25 +4644,16 @@ export interface WorkbooksOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Workbooks} [result] - The deserialized result object if an error did not occur. - * See {@link Workbooks} for more information. + * {WorkbooksListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WorkbooksListResult} for more information. * * {WebResource} [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, category: string, options?: { tags? : string[], canFetchContent? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, category: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, category: string, options: { tags? : string[], canFetchContent? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * WorkbookOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the ApplicationInsightsManagementClient. - */ -export interface WorkbookOperations { + listByResourceGroup(resourceGroupName: string, category: string, options?: { tags? : string[], canFetchContent? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, category: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, category: string, options: { tags? : string[], canFetchContent? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** diff --git a/lib/services/applicationinsights/lib/operations/index.js b/lib/services/applicationinsights/lib/operations/index.js index e3a91e4d8e..7d68215c66 100644 --- a/lib/services/applicationinsights/lib/operations/index.js +++ b/lib/services/applicationinsights/lib/operations/index.js @@ -26,9 +26,7 @@ exports.ProactiveDetectionConfigurations = require('./proactiveDetectionConfigur exports.Components = require('./components'); exports.WorkItemConfigurations = require('./workItemConfigurations'); exports.Favorites = require('./favorites'); -exports.Favorite = require('./favorite'); exports.WebTestLocations = require('./webTestLocations'); exports.WebTests = require('./webTests'); -exports.AnalyticsItem = require('./analyticsItem'); -exports.WorkbooksOperations = require('./workbooksOperations'); -exports.WorkbookOperations = require('./workbookOperations'); +exports.AnalyticsItems = require('./analyticsItems'); +exports.Workbooks = require('./workbooks'); diff --git a/lib/services/applicationinsights/lib/operations/workItemConfigurations.js b/lib/services/applicationinsights/lib/operations/workItemConfigurations.js index 12cf0121a1..12da50b54d 100644 --- a/lib/services/applicationinsights/lib/operations/workItemConfigurations.js +++ b/lib/services/applicationinsights/lib/operations/workItemConfigurations.js @@ -33,7 +33,9 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WorkItemConfigurationsListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -145,21 +147,7 @@ function _list(resourceGroupName, resourceName, options, callback) { 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: 'WorkItemConfigurationElementType', - type: { - name: 'Composite', - className: 'WorkItemConfiguration' - } - } - } - }; + let resultMapper = new client.models['WorkItemConfigurationsListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -687,7 +675,7 @@ class WorkItemConfigurations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -725,7 +713,7 @@ class WorkItemConfigurations { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {WorkItemConfigurationsListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -733,7 +721,9 @@ class WorkItemConfigurations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WorkItemConfigurationsListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/applicationinsights/lib/operations/workbooks.js b/lib/services/applicationinsights/lib/operations/workbooks.js new file mode 100644 index 0000000000..dafde7819a --- /dev/null +++ b/lib/services/applicationinsights/lib/operations/workbooks.js @@ -0,0 +1,1517 @@ +/* + * 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; + +/** + * Get all Workbooks defined within a specified resource group and category. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} category Category of workbook to return. Possible values + * include: 'workbook', 'TSG', 'performance', 'retention' + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.tags] Tags presents on each workbook returned. + * + * @param {boolean} [options.canFetchContent] Flag indicating whether or not to + * return the full content for each applicable workbook. If false, only return + * summary content for workbooks. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WorkbooksListResult} for more information. + * + * {object} [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, category, options, callback) { + /* jshint 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 tags = (options && options.tags !== undefined) ? options.tags : undefined; + let canFetchContent = (options && options.canFetchContent !== undefined) ? options.canFetchContent : 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (category === null || category === undefined || typeof category.valueOf() !== 'string') { + throw new Error('category cannot be null or undefined and it must be of type string.'); + } + if (Array.isArray(tags)) { + for (let i = 0; i < tags.length; i++) { + if (tags[i] !== null && tags[i] !== undefined && typeof tags[i].valueOf() !== 'string') { + throw new Error('tags[i] must be of type string.'); + } + } + } + if (canFetchContent !== null && canFetchContent !== undefined && typeof canFetchContent !== 'boolean') { + throw new Error('canFetchContent must be of type boolean.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('category=' + encodeURIComponent(category)); + if (tags !== null && tags !== undefined) { + queryParameters.push('tags=' + encodeURIComponent(tags.join(','))); + } + if (canFetchContent !== null && canFetchContent !== undefined) { + queryParameters.push('canFetchContent=' + encodeURIComponent(canFetchContent.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['WorkbookError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkbooksListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get a single workbook by its resourceName. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * 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 Workbook} for more information. + * + * {object} [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, resourceName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.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['WorkbookError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Workbook']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Delete a workbook. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * 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 _deleteMethod(resourceGroupName, resourceName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.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 !== 201 && 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['WorkbookError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Create a new workbook. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {object} workbookProperties Properties that need to be specified to + * create a new workbook. + * + * @param {string} [workbookProperties.kind] The kind of workbook. Choices are + * user and shared. Possible values include: 'user', 'shared' + * + * @param {string} workbookProperties.workbookName The user-defined name of the + * workbook. + * + * @param {string} workbookProperties.serializedData Configuration of this + * particular workbook. Configuration data is a string containing valid JSON + * + * @param {string} [workbookProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * workbook. + * + * @param {string} workbookProperties.workbookId Internally assigned unique id + * of the workbook definition. + * + * @param {string} workbookProperties.sharedTypeKind Enum indicating if this + * workbook definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'user', 'shared' + * + * @param {string} workbookProperties.category Workbook category, as defined by + * the user at creation time. + * + * @param {array} [workbookProperties.workbookTags] A list of 0 or more tags + * that are associated with this workbook definition + * + * @param {string} workbookProperties.userId Unique user id of the specific + * user that owns this workbook. + * + * @param {string} [workbookProperties.sourceResourceId] Optional resourceId + * for a source resource. + * + * @param {string} [workbookProperties.location] Resource location + * + * @param {object} [workbookProperties.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 Workbook} for more information. + * + * {object} [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, resourceName, workbookProperties, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (workbookProperties === null || workbookProperties === undefined) { + throw new Error('workbookProperties cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.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 (workbookProperties !== null && workbookProperties !== undefined) { + let requestModelMapper = new client.models['Workbook']().mapper(); + requestModel = client.serialize(requestModelMapper, workbookProperties, 'workbookProperties'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(workbookProperties, 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['WorkbookError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Workbook']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['Workbook']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates a workbook that has already been added. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {object} workbookProperties Properties that need to be specified to + * create a new workbook. + * + * @param {string} [workbookProperties.kind] The kind of workbook. Choices are + * user and shared. Possible values include: 'user', 'shared' + * + * @param {string} workbookProperties.workbookName The user-defined name of the + * workbook. + * + * @param {string} workbookProperties.serializedData Configuration of this + * particular workbook. Configuration data is a string containing valid JSON + * + * @param {string} [workbookProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * workbook. + * + * @param {string} workbookProperties.workbookId Internally assigned unique id + * of the workbook definition. + * + * @param {string} workbookProperties.sharedTypeKind Enum indicating if this + * workbook definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'user', 'shared' + * + * @param {string} workbookProperties.category Workbook category, as defined by + * the user at creation time. + * + * @param {array} [workbookProperties.workbookTags] A list of 0 or more tags + * that are associated with this workbook definition + * + * @param {string} workbookProperties.userId Unique user id of the specific + * user that owns this workbook. + * + * @param {string} [workbookProperties.sourceResourceId] Optional resourceId + * for a source resource. + * + * @param {string} [workbookProperties.location] Resource location + * + * @param {object} [workbookProperties.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 Workbook} for more information. + * + * {object} [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, resourceName, workbookProperties, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (workbookProperties === null || workbookProperties === undefined) { + throw new Error('workbookProperties cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.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 (workbookProperties !== null && workbookProperties !== undefined) { + let requestModelMapper = new client.models['Workbook']().mapper(); + requestModel = client.serialize(requestModelMapper, workbookProperties, 'workbookProperties'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(workbookProperties, 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['WorkbookError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Workbook']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Workbooks. */ +class Workbooks { + /** + * Create a Workbooks. + * @param {ApplicationInsightsManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} category Category of workbook to return. Possible values + * include: 'workbook', 'TSG', 'performance', 'retention' + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.tags] Tags presents on each workbook returned. + * + * @param {boolean} [options.canFetchContent] Flag indicating whether or not to + * return the full content for each applicable workbook. If false, only return + * summary content for workbooks. + * + * @param {object} [options.customHeaders] Headers 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, category, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, category, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} category Category of workbook to return. Possible values + * include: 'workbook', 'TSG', 'performance', 'retention' + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.tags] Tags presents on each workbook returned. + * + * @param {boolean} [options.canFetchContent] Flag indicating whether or not to + * return the full content for each applicable workbook. If false, only return + * summary content for workbooks. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WorkbooksListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WorkbooksListResult} for more information. + * + * {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, category, options, optionalCallback) { + 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, category, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, category, options, optionalCallback); + } + } + + /** + * Get a single workbook by its resourceName. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * 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. + */ + getWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get a single workbook by its resourceName. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * 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 {Workbook} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Workbook} for more information. + * + * {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, resourceName, options, optionalCallback) { + 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, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, resourceName, options, optionalCallback); + } + } + + /** + * Delete a workbook. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete a workbook. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * 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. + */ + deleteMethod(resourceGroupName, resourceName, options, optionalCallback) { + 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, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, resourceName, options, optionalCallback); + } + } + + /** + * Create a new workbook. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {object} workbookProperties Properties that need to be specified to + * create a new workbook. + * + * @param {string} [workbookProperties.kind] The kind of workbook. Choices are + * user and shared. Possible values include: 'user', 'shared' + * + * @param {string} workbookProperties.workbookName The user-defined name of the + * workbook. + * + * @param {string} workbookProperties.serializedData Configuration of this + * particular workbook. Configuration data is a string containing valid JSON + * + * @param {string} [workbookProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * workbook. + * + * @param {string} workbookProperties.workbookId Internally assigned unique id + * of the workbook definition. + * + * @param {string} workbookProperties.sharedTypeKind Enum indicating if this + * workbook definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'user', 'shared' + * + * @param {string} workbookProperties.category Workbook category, as defined by + * the user at creation time. + * + * @param {array} [workbookProperties.workbookTags] A list of 0 or more tags + * that are associated with this workbook definition + * + * @param {string} workbookProperties.userId Unique user id of the specific + * user that owns this workbook. + * + * @param {string} [workbookProperties.sourceResourceId] Optional resourceId + * for a source resource. + * + * @param {string} [workbookProperties.location] Resource location + * + * @param {object} [workbookProperties.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, resourceName, workbookProperties, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, resourceName, workbookProperties, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create a new workbook. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {object} workbookProperties Properties that need to be specified to + * create a new workbook. + * + * @param {string} [workbookProperties.kind] The kind of workbook. Choices are + * user and shared. Possible values include: 'user', 'shared' + * + * @param {string} workbookProperties.workbookName The user-defined name of the + * workbook. + * + * @param {string} workbookProperties.serializedData Configuration of this + * particular workbook. Configuration data is a string containing valid JSON + * + * @param {string} [workbookProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * workbook. + * + * @param {string} workbookProperties.workbookId Internally assigned unique id + * of the workbook definition. + * + * @param {string} workbookProperties.sharedTypeKind Enum indicating if this + * workbook definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'user', 'shared' + * + * @param {string} workbookProperties.category Workbook category, as defined by + * the user at creation time. + * + * @param {array} [workbookProperties.workbookTags] A list of 0 or more tags + * that are associated with this workbook definition + * + * @param {string} workbookProperties.userId Unique user id of the specific + * user that owns this workbook. + * + * @param {string} [workbookProperties.sourceResourceId] Optional resourceId + * for a source resource. + * + * @param {string} [workbookProperties.location] Resource location + * + * @param {object} [workbookProperties.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 {Workbook} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Workbook} for more information. + * + * {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, resourceName, workbookProperties, options, optionalCallback) { + 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, resourceName, workbookProperties, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, resourceName, workbookProperties, options, optionalCallback); + } + } + + /** + * Updates a workbook that has already been added. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {object} workbookProperties Properties that need to be specified to + * create a new workbook. + * + * @param {string} [workbookProperties.kind] The kind of workbook. Choices are + * user and shared. Possible values include: 'user', 'shared' + * + * @param {string} workbookProperties.workbookName The user-defined name of the + * workbook. + * + * @param {string} workbookProperties.serializedData Configuration of this + * particular workbook. Configuration data is a string containing valid JSON + * + * @param {string} [workbookProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * workbook. + * + * @param {string} workbookProperties.workbookId Internally assigned unique id + * of the workbook definition. + * + * @param {string} workbookProperties.sharedTypeKind Enum indicating if this + * workbook definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'user', 'shared' + * + * @param {string} workbookProperties.category Workbook category, as defined by + * the user at creation time. + * + * @param {array} [workbookProperties.workbookTags] A list of 0 or more tags + * that are associated with this workbook definition + * + * @param {string} workbookProperties.userId Unique user id of the specific + * user that owns this workbook. + * + * @param {string} [workbookProperties.sourceResourceId] Optional resourceId + * for a source resource. + * + * @param {string} [workbookProperties.location] Resource location + * + * @param {object} [workbookProperties.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. + */ + updateWithHttpOperationResponse(resourceGroupName, resourceName, workbookProperties, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, resourceName, workbookProperties, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a workbook that has already been added. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the Application Insights component + * resource. + * + * @param {object} workbookProperties Properties that need to be specified to + * create a new workbook. + * + * @param {string} [workbookProperties.kind] The kind of workbook. Choices are + * user and shared. Possible values include: 'user', 'shared' + * + * @param {string} workbookProperties.workbookName The user-defined name of the + * workbook. + * + * @param {string} workbookProperties.serializedData Configuration of this + * particular workbook. Configuration data is a string containing valid JSON + * + * @param {string} [workbookProperties.version] This instance's version of the + * data model. This can change as new features are added that can be marked + * workbook. + * + * @param {string} workbookProperties.workbookId Internally assigned unique id + * of the workbook definition. + * + * @param {string} workbookProperties.sharedTypeKind Enum indicating if this + * workbook definition is owned by a specific user or is shared between all + * users with access to the Application Insights component. Possible values + * include: 'user', 'shared' + * + * @param {string} workbookProperties.category Workbook category, as defined by + * the user at creation time. + * + * @param {array} [workbookProperties.workbookTags] A list of 0 or more tags + * that are associated with this workbook definition + * + * @param {string} workbookProperties.userId Unique user id of the specific + * user that owns this workbook. + * + * @param {string} [workbookProperties.sourceResourceId] Optional resourceId + * for a source resource. + * + * @param {string} [workbookProperties.location] Resource location + * + * @param {object} [workbookProperties.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 {Workbook} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Workbook} for more information. + * + * {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, resourceName, workbookProperties, options, optionalCallback) { + 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, resourceName, workbookProperties, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, resourceName, workbookProperties, options, optionalCallback); + } + } + +} + +module.exports = Workbooks; diff --git a/lib/services/applicationinsights/package.json b/lib/services/applicationinsights/package.json index 7e7a6025c2..514b95241d 100644 --- a/lib/services/applicationinsights/package.json +++ b/lib/services/applicationinsights/package.json @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/applicationInsightsManagementClient.js", "types": "./lib/applicationInsightsManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } diff --git a/lib/services/authorizationManagement/LICENSE.txt b/lib/services/authorizationManagement/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/authorizationManagement/LICENSE.txt +++ b/lib/services/authorizationManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/authorizationManagement/README.md b/lib/services/authorizationManagement/README.md index 7596580b9d..486c6569ab 100644 --- a/lib/services/authorizationManagement/README.md +++ b/lib/services/authorizationManagement/README.md @@ -1,40 +1,40 @@ ---- -uid: azure-arm-authorization -summary: *content - ---- -# Microsoft Azure SDK for Node.js - AuthorizationManagementClient -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-authorization -``` - -## How to use - -### Authentication, client creation and list classicAdministrators as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const AuthorizationManagementClient = require("azure-arm-authorization"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new AuthorizationManagementClient(creds, subscriptionId); - return client.classicAdministrators.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error ocurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-arm-authorization +summary: *content + +--- +# Microsoft Azure SDK for Node.js - AuthorizationManagementClient +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-authorization +``` + +## How to use + +### Authentication, client creation and list classicAdministrators as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const AuthorizationManagementClient = require("azure-arm-authorization"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new AuthorizationManagementClient(creds, subscriptionId); + return client.classicAdministrators.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/authorizationManagement/lib/authorizationManagementClient.d.ts b/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts index cbf4478cb8..f9ed67fe31 100644 --- a/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts +++ b/lib/services/authorizationManagement/lib/authorizationManagementClient.d.ts @@ -34,11 +34,11 @@ export default class AuthorizationManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -59,6 +59,7 @@ export default class AuthorizationManagementClient extends AzureServiceClient { permissions: operations.Permissions; roleAssignments: operations.RoleAssignments; roleDefinitions: operations.RoleDefinitions; + denyAssignments: operations.DenyAssignments; } export { AuthorizationManagementClient, models as AuthorizationManagementModels }; diff --git a/lib/services/authorizationManagement/lib/authorizationManagementClient.js b/lib/services/authorizationManagement/lib/authorizationManagementClient.js index 7f66962384..fccd8f0ca8 100644 --- a/lib/services/authorizationManagement/lib/authorizationManagementClient.js +++ b/lib/services/authorizationManagement/lib/authorizationManagementClient.js @@ -34,9 +34,9 @@ class AuthorizationManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -76,6 +76,7 @@ class AuthorizationManagementClient extends ServiceClient { this.permissions = new operations.Permissions(this); this.roleAssignments = new operations.RoleAssignments(this); this.roleDefinitions = new operations.RoleDefinitions(this); + this.denyAssignments = new operations.DenyAssignments(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/authorizationManagement/lib/models/denyAssignment.js b/lib/services/authorizationManagement/lib/models/denyAssignment.js new file mode 100644 index 0000000000..1c72e427e1 --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/denyAssignment.js @@ -0,0 +1,165 @@ +/* + * 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'; + +/** + * Deny Assignment + * + */ +class DenyAssignment { + /** + * Create a DenyAssignment. + * @member {string} [id] The deny assignment ID. + * @member {string} [name] The deny assignment name. + * @member {string} [type] The deny assignment type. + * @member {string} [denyAssignmentName] The display name of the deny + * assignment. + * @member {string} [description] The description of the deny assignment. + * @member {array} [permissions] An array of permissions that are denied by + * the deny assignment. + * @member {string} [scope] The deny assignment scope. + * @member {boolean} [doNotApplyToChildScopes] Determines if the deny + * assignment applies to child scopes. Default value is false. + * @member {array} [principals] Array of principals to which the deny + * assignment applies. + * @member {array} [excludePrincipals] Array of principals to which the deny + * assignment does not apply. + * @member {boolean} [isSystemProtected] Specifies whether this deny + * assignment was created by Azure and cannot be edited or deleted. + */ + constructor() { + } + + /** + * Defines the metadata of DenyAssignment + * + * @returns {object} metadata of DenyAssignment + * + */ + mapper() { + return { + required: false, + serializedName: 'DenyAssignment', + type: { + name: 'Composite', + className: 'DenyAssignment', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + denyAssignmentName: { + required: false, + serializedName: 'properties.denyAssignmentName', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + permissions: { + required: false, + serializedName: 'properties.permissions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DenyAssignmentPermissionElementType', + type: { + name: 'Composite', + className: 'DenyAssignmentPermission' + } + } + } + }, + scope: { + required: false, + serializedName: 'properties.scope', + type: { + name: 'String' + } + }, + doNotApplyToChildScopes: { + required: false, + serializedName: 'properties.doNotApplyToChildScopes', + type: { + name: 'Boolean' + } + }, + principals: { + required: false, + serializedName: 'properties.principals', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrincipalElementType', + type: { + name: 'Composite', + className: 'Principal' + } + } + } + }, + excludePrincipals: { + required: false, + serializedName: 'properties.excludePrincipals', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrincipalElementType', + type: { + name: 'Composite', + className: 'Principal' + } + } + } + }, + isSystemProtected: { + required: false, + serializedName: 'properties.isSystemProtected', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = DenyAssignment; diff --git a/lib/services/authorizationManagement/lib/models/denyAssignmentFilter.js b/lib/services/authorizationManagement/lib/models/denyAssignmentFilter.js new file mode 100644 index 0000000000..eb20e0ab9e --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/denyAssignmentFilter.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Deny Assignments filter + * + */ +class DenyAssignmentFilter { + /** + * Create a DenyAssignmentFilter. + * @member {string} [denyAssignmentName] Return deny assignment with + * specified name. + * @member {string} [principalId] Return all deny assignments where the + * specified principal is listed in the principals list of deny assignments. + * @member {string} [gdprExportPrincipalId] Return all deny assignments where + * the specified principal is listed either in the principals list or exclude + * principals list of deny assignments. + */ + constructor() { + } + + /** + * Defines the metadata of DenyAssignmentFilter + * + * @returns {object} metadata of DenyAssignmentFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'DenyAssignmentFilter', + type: { + name: 'Composite', + className: 'DenyAssignmentFilter', + modelProperties: { + denyAssignmentName: { + required: false, + serializedName: 'denyAssignmentName', + type: { + name: 'String' + } + }, + principalId: { + required: false, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + gdprExportPrincipalId: { + required: false, + serializedName: 'gdprExportPrincipalId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DenyAssignmentFilter; diff --git a/lib/services/authorizationManagement/lib/models/denyAssignmentListResult.js b/lib/services/authorizationManagement/lib/models/denyAssignmentListResult.js new file mode 100644 index 0000000000..50127cab67 --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/denyAssignmentListResult.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'; + +/** + * Deny assignment list operation result. + */ +class DenyAssignmentListResult extends Array { + /** + * Create a DenyAssignmentListResult. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DenyAssignmentListResult + * + * @returns {object} metadata of DenyAssignmentListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DenyAssignmentListResult', + type: { + name: 'Composite', + className: 'DenyAssignmentListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DenyAssignmentElementType', + type: { + name: 'Composite', + className: 'DenyAssignment' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DenyAssignmentListResult; diff --git a/lib/services/authorizationManagement/lib/models/denyAssignmentPermission.js b/lib/services/authorizationManagement/lib/models/denyAssignmentPermission.js new file mode 100644 index 0000000000..0becb5dc4a --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/denyAssignmentPermission.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'; + +/** + * Deny assignment permissions. + * + */ +class DenyAssignmentPermission { + /** + * Create a DenyAssignmentPermission. + * @member {array} [actions] Actions to which the deny assignment does not + * grant access. + * @member {array} [notActions] Actions to exclude from that the deny + * assignment does not grant access. + * @member {array} [dataActions] Data actions to which the deny assignment + * does not grant access. + * @member {array} [notDataActions] Data actions to exclude from that the + * deny assignment does not grant access. + */ + constructor() { + } + + /** + * Defines the metadata of DenyAssignmentPermission + * + * @returns {object} metadata of DenyAssignmentPermission + * + */ + mapper() { + return { + required: false, + serializedName: 'DenyAssignmentPermission', + type: { + name: 'Composite', + className: 'DenyAssignmentPermission', + modelProperties: { + actions: { + required: false, + serializedName: 'actions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notActions: { + required: false, + serializedName: 'notActions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + dataActions: { + required: false, + serializedName: 'dataActions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notDataActions: { + required: false, + serializedName: 'notDataActions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = DenyAssignmentPermission; diff --git a/lib/services/authorizationManagement/lib/models/index.d.ts b/lib/services/authorizationManagement/lib/models/index.d.ts index 054ebbae5c..1d81952731 100644 --- a/lib/services/authorizationManagement/lib/models/index.d.ts +++ b/lib/services/authorizationManagement/lib/models/index.d.ts @@ -200,20 +200,120 @@ export interface RoleAssignment { * @constructor * Role assignment create parameters. * - * @member {string} [roleDefinitionId] The role definition ID used in the role + * @member {string} roleDefinitionId The role definition ID used in the role * assignment. - * @member {string} [principalId] The principal ID assigned to the role. This + * @member {string} principalId The principal ID assigned to the role. This * maps to the ID inside the Active Directory. It can point to a user, service * principal, or security group. * @member {boolean} [canDelegate] The delgation flag used for creating a role * assignment */ export interface RoleAssignmentCreateParameters { - roleDefinitionId?: string; - principalId?: string; + roleDefinitionId: string; + principalId: string; canDelegate?: boolean; } +/** + * @class + * Initializes a new instance of the DenyAssignmentFilter class. + * @constructor + * Deny Assignments filter + * + * @member {string} [denyAssignmentName] Return deny assignment with specified + * name. + * @member {string} [principalId] Return all deny assignments where the + * specified principal is listed in the principals list of deny assignments. + * @member {string} [gdprExportPrincipalId] Return all deny assignments where + * the specified principal is listed either in the principals list or exclude + * principals list of deny assignments. + */ +export interface DenyAssignmentFilter { + denyAssignmentName?: string; + principalId?: string; + gdprExportPrincipalId?: string; +} + +/** + * @class + * Initializes a new instance of the DenyAssignmentPermission class. + * @constructor + * Deny assignment permissions. + * + * @member {array} [actions] Actions to which the deny assignment does not + * grant access. + * @member {array} [notActions] Actions to exclude from that the deny + * assignment does not grant access. + * @member {array} [dataActions] Data actions to which the deny assignment does + * not grant access. + * @member {array} [notDataActions] Data actions to exclude from that the deny + * assignment does not grant access. + */ +export interface DenyAssignmentPermission { + actions?: string[]; + notActions?: string[]; + dataActions?: string[]; + notDataActions?: string[]; +} + +/** + * @class + * Initializes a new instance of the Principal class. + * @constructor + * Deny assignment principal. + * + * @member {string} [id] Object ID of the Azure AD principal (user, group, or + * service principal) to which the deny assignment applies. An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal type as + * 'Everyone' represents all users, groups and service principals. + * @member {string} [type] Type of object represented by principal id (user, + * group, or service principal). An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal type as + * 'Everyone' represents all users, groups and service principals. + */ +export interface Principal { + readonly id?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the DenyAssignment class. + * @constructor + * Deny Assignment + * + * @member {string} [id] The deny assignment ID. + * @member {string} [name] The deny assignment name. + * @member {string} [type] The deny assignment type. + * @member {string} [denyAssignmentName] The display name of the deny + * assignment. + * @member {string} [description] The description of the deny assignment. + * @member {array} [permissions] An array of permissions that are denied by the + * deny assignment. + * @member {string} [scope] The deny assignment scope. + * @member {boolean} [doNotApplyToChildScopes] Determines if the deny + * assignment applies to child scopes. Default value is false. + * @member {array} [principals] Array of principals to which the deny + * assignment applies. + * @member {array} [excludePrincipals] Array of principals to which the deny + * assignment does not apply. + * @member {boolean} [isSystemProtected] Specifies whether this deny assignment + * was created by Azure and cannot be edited or deleted. + */ +export interface DenyAssignment { + readonly id?: string; + readonly name?: string; + readonly type?: string; + denyAssignmentName?: string; + description?: string; + permissions?: DenyAssignmentPermission[]; + scope?: string; + doNotApplyToChildScopes?: boolean; + principals?: Principal[]; + excludePrincipals?: Principal[]; + isSystemProtected?: boolean; +} + /** * @class @@ -279,3 +379,16 @@ export interface RoleAssignmentListResult extends Array { export interface RoleDefinitionListResult extends Array { nextLink?: string; } + +/** + * @class + * Initializes a new instance of the DenyAssignmentListResult class. + * @constructor + * Deny assignment list operation result. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ +export interface DenyAssignmentListResult extends Array { + nextLink?: string; +} diff --git a/lib/services/authorizationManagement/lib/models/index.js b/lib/services/authorizationManagement/lib/models/index.js index aedb81d269..bba8055f71 100644 --- a/lib/services/authorizationManagement/lib/models/index.js +++ b/lib/services/authorizationManagement/lib/models/index.js @@ -28,8 +28,13 @@ exports.RoleDefinition = require('./roleDefinition'); exports.RoleAssignmentFilter = require('./roleAssignmentFilter'); exports.RoleAssignment = require('./roleAssignment'); exports.RoleAssignmentCreateParameters = require('./roleAssignmentCreateParameters'); +exports.DenyAssignmentFilter = require('./denyAssignmentFilter'); +exports.DenyAssignmentPermission = require('./denyAssignmentPermission'); +exports.Principal = require('./principal'); +exports.DenyAssignment = require('./denyAssignment'); exports.ClassicAdministratorListResult = require('./classicAdministratorListResult'); exports.ProviderOperationsMetadataListResult = require('./providerOperationsMetadataListResult'); exports.PermissionGetResult = require('./permissionGetResult'); exports.RoleAssignmentListResult = require('./roleAssignmentListResult'); exports.RoleDefinitionListResult = require('./roleDefinitionListResult'); +exports.DenyAssignmentListResult = require('./denyAssignmentListResult'); diff --git a/lib/services/authorizationManagement/lib/models/principal.js b/lib/services/authorizationManagement/lib/models/principal.js new file mode 100644 index 0000000000..35b4e07596 --- /dev/null +++ b/lib/services/authorizationManagement/lib/models/principal.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'; + +/** + * Deny assignment principal. + * + */ +class Principal { + /** + * Create a Principal. + * @member {string} [id] Object ID of the Azure AD principal (user, group, or + * service principal) to which the deny assignment applies. An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal type + * as 'Everyone' represents all users, groups and service principals. + * @member {string} [type] Type of object represented by principal id (user, + * group, or service principal). An empty guid + * '00000000-0000-0000-0000-000000000000' as principal id and principal type + * as 'Everyone' represents all users, groups and service principals. + */ + constructor() { + } + + /** + * Defines the metadata of Principal + * + * @returns {object} metadata of Principal + * + */ + mapper() { + return { + required: false, + serializedName: 'Principal', + type: { + name: 'Composite', + className: 'Principal', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Principal; diff --git a/lib/services/authorizationManagement/lib/models/providerOperationsMetadata.js b/lib/services/authorizationManagement/lib/models/providerOperationsMetadata.js index 93e590f6cb..5c455692ca 100644 --- a/lib/services/authorizationManagement/lib/models/providerOperationsMetadata.js +++ b/lib/services/authorizationManagement/lib/models/providerOperationsMetadata.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Provider Operations metadata * diff --git a/lib/services/authorizationManagement/lib/models/resourceType.js b/lib/services/authorizationManagement/lib/models/resourceType.js index 49599002c0..10ebee67b5 100644 --- a/lib/services/authorizationManagement/lib/models/resourceType.js +++ b/lib/services/authorizationManagement/lib/models/resourceType.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Resource Type * diff --git a/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js b/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js index 1d631e6965..d8bdf2e41e 100644 --- a/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js +++ b/lib/services/authorizationManagement/lib/models/roleAssignmentCreateParameters.js @@ -17,9 +17,9 @@ class RoleAssignmentCreateParameters { /** * Create a RoleAssignmentCreateParameters. - * @member {string} [roleDefinitionId] The role definition ID used in the - * role assignment. - * @member {string} [principalId] The principal ID assigned to the role. This + * @member {string} roleDefinitionId The role definition ID used in the role + * assignment. + * @member {string} principalId The principal ID assigned to the role. This * maps to the ID inside the Active Directory. It can point to a user, * service principal, or security group. * @member {boolean} [canDelegate] The delgation flag used for creating a @@ -43,14 +43,14 @@ class RoleAssignmentCreateParameters { className: 'RoleAssignmentCreateParameters', modelProperties: { roleDefinitionId: { - required: false, + required: true, serializedName: 'properties.roleDefinitionId', type: { name: 'String' } }, principalId: { - required: false, + required: true, serializedName: 'properties.principalId', type: { name: 'String' diff --git a/lib/services/authorizationManagement/lib/models/roleDefinition.js b/lib/services/authorizationManagement/lib/models/roleDefinition.js index 89e214622b..76ab1c56ff 100644 --- a/lib/services/authorizationManagement/lib/models/roleDefinition.js +++ b/lib/services/authorizationManagement/lib/models/roleDefinition.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Role definition. * diff --git a/lib/services/authorizationManagement/lib/operations/denyAssignments.js b/lib/services/authorizationManagement/lib/operations/denyAssignments.js new file mode 100644 index 0000000000..e079285ca7 --- /dev/null +++ b/lib/services/authorizationManagement/lib/operations/denyAssignments.js @@ -0,0 +1,2446 @@ +/* + * 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; + +/** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, callback) { + /* jshint 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; + let apiVersion = '2018-07-01-preview'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceProviderNamespace === null || resourceProviderNamespace === undefined || typeof resourceProviderNamespace.valueOf() !== 'string') { + throw new Error('resourceProviderNamespace cannot be null or undefined and it must be of type string.'); + } + if (parentResourcePath === null || parentResourcePath === undefined || typeof parentResourcePath.valueOf() !== 'string') { + throw new Error('parentResourcePath cannot be null or undefined and it must be of type string.'); + } + if (resourceType === null || resourceType === undefined || typeof resourceType.valueOf() !== 'string') { + throw new Error('resourceType cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/denyAssignments'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceProviderNamespace}', encodeURIComponent(resourceProviderNamespace)); + requestUrl = requestUrl.replace('{parentResourcePath}', parentResourcePath); + requestUrl = requestUrl.replace('{resourceType}', resourceType); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForResourceGroup(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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-07-01-preview'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/denyAssignments'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-07-01-preview'; + // 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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.Authorization/denyAssignments'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {object} [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(scope, denyAssignmentId, options, callback) { + /* jshint 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 apiVersion = '2018-07-01-preview'; + // Validate + try { + if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { + throw new Error('scope cannot be null or undefined and it must be of type string.'); + } + if (denyAssignmentId === null || denyAssignmentId === undefined || typeof denyAssignmentId.valueOf() !== 'string') { + throw new Error('denyAssignmentId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}'; + requestUrl = requestUrl.replace('{scope}', scope); + requestUrl = requestUrl.replace('{denyAssignmentId}', encodeURIComponent(denyAssignmentId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignment']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getById(denyAssignmentId, options, callback) { + /* jshint 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 apiVersion = '2018-07-01-preview'; + // Validate + try { + if (denyAssignmentId === null || denyAssignmentId === undefined || typeof denyAssignmentId.valueOf() !== 'string') { + throw new Error('denyAssignmentId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{denyAssignmentId}'; + requestUrl = requestUrl.replace('{denyAssignmentId}', denyAssignmentId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignment']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForScope(scope, options, callback) { + /* jshint 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; + let apiVersion = '2018-07-01-preview'; + // Validate + try { + if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { + throw new Error('scope 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{scope}/providers/Microsoft.Authorization/denyAssignments'; + requestUrl = requestUrl.replace('{scope}', scope); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous 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 DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForResourceNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for 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 DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all deny assignments for 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 DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous 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 DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listForScopeNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DenyAssignmentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 DenyAssignments. */ +class DenyAssignments { + /** + * Create a DenyAssignments. + * @param {AuthorizationManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listForResource = _listForResource; + this._listForResourceGroup = _listForResourceGroup; + this._list = _list; + this._get = _get; + this._getById = _getById; + this._listForScope = _listForScope; + this._listForResourceNext = _listForResourceNext; + this._listForResourceGroupNext = _listForResourceGroupNext; + this._listNext = _listNext; + this._listForScopeNext = _listForScopeNext; + } + + /** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForResourceWithHttpOperationResponse(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options, optionalCallback); + } + } + + /** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceGroup(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._listForResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {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); + } + } + + /** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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(scope, denyAssignmentId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(scope, denyAssignmentId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignment} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {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(scope, denyAssignmentId, options, optionalCallback) { + 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(scope, denyAssignmentId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(scope, denyAssignmentId, options, optionalCallback); + } + } + + /** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getByIdWithHttpOperationResponse(denyAssignmentId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getById(denyAssignmentId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignment} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getById(denyAssignmentId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getById(denyAssignmentId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getById(denyAssignmentId, options, optionalCallback); + } + } + + /** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForScopeWithHttpOperationResponse(scope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForScope(scope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForScope(scope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listForScope(scope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForScope(scope, options, optionalCallback); + } + } + + /** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForResourceNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForResourceNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous 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 {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceNext(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._listForResourceNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForResourceNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets deny assignments for 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. + */ + listForResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for 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 {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceGroupNext(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._listForResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets all deny assignments for 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; + }); + }); + } + + /** + * Gets all deny assignments for 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 {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {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); + } + } + + /** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listForScopeNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listForScopeNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous 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 {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listForScopeNext(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._listForScopeNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listForScopeNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = DenyAssignments; diff --git a/lib/services/authorizationManagement/lib/operations/index.d.ts b/lib/services/authorizationManagement/lib/operations/index.d.ts index 1451a13434..943144b336 100644 --- a/lib/services/authorizationManagement/lib/operations/index.d.ts +++ b/lib/services/authorizationManagement/lib/operations/index.d.ts @@ -811,10 +811,10 @@ export interface RoleAssignments { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -850,10 +850,10 @@ export interface RoleAssignments { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -1013,10 +1013,10 @@ export interface RoleAssignments { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -1043,10 +1043,10 @@ export interface RoleAssignments { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -1898,3 +1898,712 @@ export interface RoleDefinitions { listNext(nextPageLink: string, callback: ServiceCallback): void; listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * DenyAssignments + * __NOTE__: An instance of this class is automatically created for an + * instance of the AuthorizationManagementClient. + */ +export interface DenyAssignments { + + + /** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForResourceWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceProviderNamespace The namespace of the resource + * provider. + * + * @param {string} parentResourcePath The parent resource identity. + * + * @param {string} resourceType The resource type of the resource. + * + * @param {string} resourceName The name of the resource to get deny + * assignments for. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: ServiceCallback): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceGroup(resourceGroupName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listForResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listForResourceGroup(resourceGroupName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that 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?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all deny assignments for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [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?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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(scope: string, denyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the specified deny assignment. + * + * @param {string} scope The scope of the deny assignment. + * + * @param {string} denyAssignmentId The ID of the deny assignment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignment} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignment} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {WebResource} [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(scope: string, denyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(scope: string, denyAssignmentId: string, callback: ServiceCallback): void; + get(scope: string, denyAssignmentId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getByIdWithHttpOperationResponse(denyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a deny assignment by ID. + * + * @param {string} denyAssignmentId The fully qualified deny assignment ID. For + * example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + * for subscription level deny assignments, or + * /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for + * tenant level deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignment} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignment} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignment} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getById(denyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getById(denyAssignmentId: string, callback: ServiceCallback): void; + getById(denyAssignmentId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForScopeWithHttpOperationResponse(scope: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a scope. + * + * @param {string} scope The scope of the deny assignments. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. Use + * $filter=atScope() to return all deny assignments at or above the scope. Use + * $filter=denyAssignmentName eq '{name}' to search deny assignments by name at + * specified scope. Use $filter=principalId eq '{id}' to return all deny + * assignments at, above and below the scope for the specified principal. Use + * $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, + * above and below the scope for the specified principal. This filter is + * different from the principalId filter as it returns not only those deny + * assignments that contain the specified principal is the Principals list but + * also those deny assignments that contain the specified principal is the + * ExcludePrincipals list. Additionally, when gdprExportPrincipalId filter is + * used, only the deny assignment name and description properties are returned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForScope(scope: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listForScope(scope: string, callback: ServiceCallback): void; + listForScope(scope: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForResourceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a resource. + * + * @param {string} nextPageLink The NextLink from the 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 {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listForResourceNext(nextPageLink: string, callback: ServiceCallback): void; + listForResourceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets deny assignments for 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. + */ + listForResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for 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 {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listForResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listForResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all deny assignments for 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>; + + /** + * Gets all deny assignments for 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 {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [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; + + + /** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listForScopeNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets deny assignments for a scope. + * + * @param {string} nextPageLink The NextLink from the 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 {DenyAssignmentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DenyAssignmentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DenyAssignmentListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listForScopeNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listForScopeNext(nextPageLink: string, callback: ServiceCallback): void; + listForScopeNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/authorizationManagement/lib/operations/index.js b/lib/services/authorizationManagement/lib/operations/index.js index 3a264a946c..357740d773 100644 --- a/lib/services/authorizationManagement/lib/operations/index.js +++ b/lib/services/authorizationManagement/lib/operations/index.js @@ -19,3 +19,4 @@ exports.ProviderOperationsMetadataOperations = require('./providerOperationsMeta exports.Permissions = require('./permissions'); exports.RoleAssignments = require('./roleAssignments'); exports.RoleDefinitions = require('./roleDefinitions'); +exports.DenyAssignments = require('./denyAssignments'); diff --git a/lib/services/authorizationManagement/lib/operations/roleAssignments.js b/lib/services/authorizationManagement/lib/operations/roleAssignments.js index bebfb2af76..2688a75fab 100644 --- a/lib/services/authorizationManagement/lib/operations/roleAssignments.js +++ b/lib/services/authorizationManagement/lib/operations/roleAssignments.js @@ -496,10 +496,10 @@ function _deleteMethod(scope, roleAssignmentName, options, callback) { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -934,10 +934,10 @@ function _deleteById(roleId, options, callback) { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -2358,10 +2358,10 @@ class RoleAssignments { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -2409,10 +2409,10 @@ class RoleAssignments { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -2641,10 +2641,10 @@ class RoleAssignments { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * @@ -2683,10 +2683,10 @@ class RoleAssignments { * * @param {object} parameters Parameters for the role assignment. * - * @param {string} [parameters.roleDefinitionId] The role definition ID used in + * @param {string} parameters.roleDefinitionId The role definition ID used in * the role assignment. * - * @param {string} [parameters.principalId] The principal ID assigned to the + * @param {string} parameters.principalId The principal ID assigned to the * role. This maps to the ID inside the Active Directory. It can point to a * user, service principal, or security group. * diff --git a/lib/services/authorizationManagement/package.json b/lib/services/authorizationManagement/package.json index b7ee3e18f0..6f4e83345d 100644 --- a/lib/services/authorizationManagement/package.json +++ b/lib/services/authorizationManagement/package.json @@ -4,19 +4,22 @@ "description": "AuthorizationManagementClient Library with typescript type definitions for node", "version": "5.0.0", "dependencies": { - "ms-rest": "^2.3.2", + "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", "main": "./lib/authorizationManagementClient.js", "types": "./lib/authorizationManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } diff --git a/lib/services/computeManagement2/LICENSE.txt b/lib/services/computeManagement2/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/computeManagement2/LICENSE.txt +++ b/lib/services/computeManagement2/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/computeManagement2/lib/computeManagementClient.d.ts b/lib/services/computeManagement2/lib/computeManagementClient.d.ts index 4894e75f99..901a0d83cb 100644 --- a/lib/services/computeManagement2/lib/computeManagementClient.d.ts +++ b/lib/services/computeManagement2/lib/computeManagementClient.d.ts @@ -34,11 +34,11 @@ export default class ComputeManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -58,9 +58,9 @@ export default class ComputeManagementClient extends AzureServiceClient { availabilitySets: operations.AvailabilitySets; virtualMachineExtensionImages: operations.VirtualMachineExtensionImages; virtualMachineExtensions: operations.VirtualMachineExtensions; - virtualMachines: operations.VirtualMachines; virtualMachineImages: operations.VirtualMachineImages; usageOperations: operations.UsageOperations; + virtualMachines: operations.VirtualMachines; virtualMachineSizes: operations.VirtualMachineSizes; images: operations.Images; virtualMachineScaleSets: operations.VirtualMachineScaleSets; @@ -72,6 +72,9 @@ export default class ComputeManagementClient extends AzureServiceClient { resourceSkus: operations.ResourceSkus; disks: operations.Disks; snapshots: operations.Snapshots; + galleries: operations.Galleries; + galleryImages: operations.GalleryImages; + galleryImageVersions: operations.GalleryImageVersions; containerServices: operations.ContainerServices; } diff --git a/lib/services/computeManagement2/lib/computeManagementClient.js b/lib/services/computeManagement2/lib/computeManagementClient.js index 15a0e2a7d3..b610b4618f 100644 --- a/lib/services/computeManagement2/lib/computeManagementClient.js +++ b/lib/services/computeManagement2/lib/computeManagementClient.js @@ -34,9 +34,9 @@ class ComputeManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -75,9 +75,9 @@ class ComputeManagementClient extends ServiceClient { this.availabilitySets = new operations.AvailabilitySets(this); this.virtualMachineExtensionImages = new operations.VirtualMachineExtensionImages(this); this.virtualMachineExtensions = new operations.VirtualMachineExtensions(this); - this.virtualMachines = new operations.VirtualMachines(this); this.virtualMachineImages = new operations.VirtualMachineImages(this); this.usageOperations = new operations.UsageOperations(this); + this.virtualMachines = new operations.VirtualMachines(this); this.virtualMachineSizes = new operations.VirtualMachineSizes(this); this.images = new operations.Images(this); this.virtualMachineScaleSets = new operations.VirtualMachineScaleSets(this); @@ -89,6 +89,9 @@ class ComputeManagementClient extends ServiceClient { this.resourceSkus = new operations.ResourceSkus(this); this.disks = new operations.Disks(this); this.snapshots = new operations.Snapshots(this); + this.galleries = new operations.Galleries(this); + this.galleryImages = new operations.GalleryImages(this); + this.galleryImageVersions = new operations.GalleryImageVersions(this); this.containerServices = new operations.ContainerServices(this); this.models = models; msRest.addSerializationMixin(this); diff --git a/lib/services/computeManagement2/lib/models/accessUri.js b/lib/services/computeManagement2/lib/models/accessUri.js index 2f3d401a97..3fa859d644 100644 --- a/lib/services/computeManagement2/lib/models/accessUri.js +++ b/lib/services/computeManagement2/lib/models/accessUri.js @@ -39,7 +39,7 @@ class AccessUri { accessSAS: { required: false, readOnly: true, - serializedName: 'properties.output.accessSAS', + serializedName: 'accessSAS', type: { name: 'String' } diff --git a/lib/services/computeManagement2/lib/models/additionalCapabilities.js b/lib/services/computeManagement2/lib/models/additionalCapabilities.js new file mode 100644 index 0000000000..746837a474 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/additionalCapabilities.js @@ -0,0 +1,57 @@ +/* + * 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'; + +/** + * Enables or disables a capability on the virtual machine or virtual machine + * scale set. + * + */ +class AdditionalCapabilities { + /** + * Create a AdditionalCapabilities. + * @member {boolean} [ultraSSDEnabled] The flag that enables or disables a + * capability to have one or more managed data disks with UltraSSD_LRS + * storage account type on the VM or VMSS. Managed disks with storage account + * type UltraSSD_LRS can be added to a virtual machine or virtual machine + * scale set only if this property is enabled. + */ + constructor() { + } + + /** + * Defines the metadata of AdditionalCapabilities + * + * @returns {object} metadata of AdditionalCapabilities + * + */ + mapper() { + return { + required: false, + serializedName: 'AdditionalCapabilities', + type: { + name: 'Composite', + className: 'AdditionalCapabilities', + modelProperties: { + ultraSSDEnabled: { + required: false, + serializedName: 'ultraSSDEnabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = AdditionalCapabilities; diff --git a/lib/services/computeManagement2/lib/models/apiError.js b/lib/services/computeManagement2/lib/models/apiError.js index 858ddc2ea9..9fd78c1fab 100644 --- a/lib/services/computeManagement2/lib/models/apiError.js +++ b/lib/services/computeManagement2/lib/models/apiError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Api error. * diff --git a/lib/services/computeManagement2/lib/models/automaticOSUpgradePolicy.js b/lib/services/computeManagement2/lib/models/automaticOSUpgradePolicy.js new file mode 100644 index 0000000000..5b701fce6a --- /dev/null +++ b/lib/services/computeManagement2/lib/models/automaticOSUpgradePolicy.js @@ -0,0 +1,63 @@ +/* + * 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 configuration parameters used for performing automatic OS upgrade. + * + */ +class AutomaticOSUpgradePolicy { + /** + * Create a AutomaticOSUpgradePolicy. + * @member {boolean} [enableAutomaticOSUpgrade] Whether OS upgrades should + * automatically be applied to scale set instances in a rolling fashion when + * a newer version of the image becomes available. Default value is false. + * @member {boolean} [disableAutomaticRollback] Whether OS image rollback + * feature should be disabled. Default value is false. + */ + constructor() { + } + + /** + * Defines the metadata of AutomaticOSUpgradePolicy + * + * @returns {object} metadata of AutomaticOSUpgradePolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'AutomaticOSUpgradePolicy', + type: { + name: 'Composite', + className: 'AutomaticOSUpgradePolicy', + modelProperties: { + enableAutomaticOSUpgrade: { + required: false, + serializedName: 'enableAutomaticOSUpgrade', + type: { + name: 'Boolean' + } + }, + disableAutomaticRollback: { + required: false, + serializedName: 'disableAutomaticRollback', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = AutomaticOSUpgradePolicy; diff --git a/lib/services/computeManagement2/lib/models/availabilitySet.js b/lib/services/computeManagement2/lib/models/availabilitySet.js index c7cd6dd84e..dbe8ef6d2c 100644 --- a/lib/services/computeManagement2/lib/models/availabilitySet.js +++ b/lib/services/computeManagement2/lib/models/availabilitySet.js @@ -34,7 +34,10 @@ class AvailabilitySet extends models['Resource'] { * @member {array} [virtualMachines] A list of references to all virtual * machines in the availability set. * @member {array} [statuses] The resource status information. - * @member {object} [sku] Sku of the availability set + * @member {object} [sku] Sku of the availability set, only name is required + * to be set. See AvailabilitySetSkuTypes for possible set of values. Use + * 'Aligned' for virtual machines with managed disks and 'Classic' for + * virtual machines with unmanaged disks. Default value is 'Classic'. * @member {string} [sku.name] The sku name. * @member {string} [sku.tier] Specifies the tier of virtual machines in a * scale set.

Possible Values:

**Standard**


For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * should be assigned to. Only tags may be updated. * * @extends models['UpdateResource'] */ diff --git a/lib/services/computeManagement2/lib/models/bootDiagnostics.js b/lib/services/computeManagement2/lib/models/bootDiagnostics.js index 840741d822..e5976c4736 100644 --- a/lib/services/computeManagement2/lib/models/bootDiagnostics.js +++ b/lib/services/computeManagement2/lib/models/bootDiagnostics.js @@ -12,9 +12,8 @@ /** * Boot Diagnostics is a debugging feature which allows you to view Console - * Output and Screenshot to diagnose VM status.

For Linux Virtual - * Machines, you can easily view the output of your console log.

For - * both Windows and Linux virtual machines, Azure also enables you to see a + * Output and Screenshot to diagnose VM status.

You can easily view + * the output of your console log.

Azure also enables you to see a * screenshot of the VM from the hypervisor. * */ diff --git a/lib/services/computeManagement2/lib/models/bootDiagnosticsInstanceView.js b/lib/services/computeManagement2/lib/models/bootDiagnosticsInstanceView.js index e577b799be..ac22bee1dd 100644 --- a/lib/services/computeManagement2/lib/models/bootDiagnosticsInstanceView.js +++ b/lib/services/computeManagement2/lib/models/bootDiagnosticsInstanceView.js @@ -21,6 +21,17 @@ class BootDiagnosticsInstanceView { * URI. * @member {string} [serialConsoleLogBlobUri] The Linux serial console log * blob Uri. + * @member {object} [status] The boot diagnostics status information for the + * VM.

NOTE: It will be set only if there are errors encountered in + * enabling boot diagnostics. + * @member {string} [status.code] The status code. + * @member {string} [status.level] The level code. Possible values include: + * 'Info', 'Warning', 'Error' + * @member {string} [status.displayStatus] The short localizable label for + * the status. + * @member {string} [status.message] The detailed status message, including + * for alerts and error messages. + * @member {date} [status.time] The time of the status. */ constructor() { } @@ -41,6 +52,7 @@ class BootDiagnosticsInstanceView { modelProperties: { consoleScreenshotBlobUri: { required: false, + readOnly: true, serializedName: 'consoleScreenshotBlobUri', type: { name: 'String' @@ -48,10 +60,20 @@ class BootDiagnosticsInstanceView { }, serialConsoleLogBlobUri: { required: false, + readOnly: true, serializedName: 'serialConsoleLogBlobUri', type: { name: 'String' } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } } } } diff --git a/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js b/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js index 97ca03d8ab..7307cbb2d1 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js +++ b/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing a ContainerServiceDiagnosticsProfile. */ diff --git a/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js b/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js index f651f9ec06..a4c6e59a87 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js +++ b/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Profile for Linux VMs in the container service cluster. * diff --git a/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js b/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js index 49c1c1cb97..f2399c73e1 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js +++ b/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * SSH configuration for Linux-based VMs running on Azure. * diff --git a/lib/services/computeManagement2/lib/models/creationData.js b/lib/services/computeManagement2/lib/models/creationData.js index 0bd210c44a..bce32a88fb 100644 --- a/lib/services/computeManagement2/lib/models/creationData.js +++ b/lib/services/computeManagement2/lib/models/creationData.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Data used when creating a disk. * @@ -27,7 +25,7 @@ class CreationData { * import as a disk. Required only if the blob is in a different subscription * @member {object} [imageReference] Disk source information. * @member {string} [imageReference.id] A relative uri containing either a - * Platform Imgage Repository or user image reference. + * Platform Image Repository or user image reference. * @member {number} [imageReference.lun] If the disk is created from an * image's data disk, this is an index that indicates which of the data disks * in the image to use. For OS disks, this field is null. diff --git a/lib/services/computeManagement2/lib/models/dataDisk.js b/lib/services/computeManagement2/lib/models/dataDisk.js index 5a4e36bacb..60c1137744 100644 --- a/lib/services/computeManagement2/lib/models/dataDisk.js +++ b/lib/services/computeManagement2/lib/models/dataDisk.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a data disk. * @@ -46,12 +44,13 @@ class DataDisk { * using a marketplace image, you also use the plan element previously * described. Possible values include: 'FromImage', 'Empty', 'Attach' * @member {number} [diskSizeGB] Specifies the size of an empty data disk in - * gigabytes. This element can be used to overwrite the name of the disk in a + * gigabytes. This element can be used to overwrite the size of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used + * with data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ constructor() { } diff --git a/lib/services/computeManagement2/lib/models/diagnosticsProfile.js b/lib/services/computeManagement2/lib/models/diagnosticsProfile.js index 3abafdb77e..8d712a8186 100644 --- a/lib/services/computeManagement2/lib/models/diagnosticsProfile.js +++ b/lib/services/computeManagement2/lib/models/diagnosticsProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Specifies the boot diagnostic settings state.

Minimum api-version: * 2015-06-15. @@ -22,9 +20,8 @@ class DiagnosticsProfile { * Create a DiagnosticsProfile. * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature * which allows you to view Console Output and Screenshot to diagnose VM - * status.

For Linux Virtual Machines, you can easily view the - * output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * status.

You can easily view the output of your console log. + *

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {boolean} [bootDiagnostics.enabled] Whether boot diagnostics * should be enabled on the Virtual Machine. diff --git a/lib/services/computeManagement2/lib/models/diffDiskSettings.js b/lib/services/computeManagement2/lib/models/diffDiskSettings.js new file mode 100644 index 0000000000..255adbef70 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/diffDiskSettings.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'; + +/** + * Describes the parameters of differencing disk settings that can be be + * specified for operating system disk.

NOTE: The differencing disk + * settings can only be specified for managed disk. + * + */ +class DiffDiskSettings { + /** + * Create a DiffDiskSettings. + * @member {string} [option] Specifies the differencing disk settings for + * operating system disk. Possible values include: 'Local' + */ + constructor() { + } + + /** + * Defines the metadata of DiffDiskSettings + * + * @returns {object} metadata of DiffDiskSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'DiffDiskSettings', + type: { + name: 'Composite', + className: 'DiffDiskSettings', + modelProperties: { + option: { + required: false, + serializedName: 'option', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiffDiskSettings; diff --git a/lib/services/computeManagement2/lib/models/disallowed.js b/lib/services/computeManagement2/lib/models/disallowed.js new file mode 100644 index 0000000000..9376c28ab0 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/disallowed.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * Describes the disallowed disk types. + * + */ +class Disallowed { + /** + * Create a Disallowed. + * @member {array} [diskTypes] A list of disk types. + */ + constructor() { + } + + /** + * Defines the metadata of Disallowed + * + * @returns {object} metadata of Disallowed + * + */ + mapper() { + return { + required: false, + serializedName: 'Disallowed', + type: { + name: 'Composite', + className: 'Disallowed', + modelProperties: { + diskTypes: { + required: false, + serializedName: 'diskTypes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = Disallowed; diff --git a/lib/services/computeManagement2/lib/models/disk.js b/lib/services/computeManagement2/lib/models/disk.js index 470ae2c184..2fb2c6d801 100644 --- a/lib/services/computeManagement2/lib/models/disk.js +++ b/lib/services/computeManagement2/lib/models/disk.js @@ -24,7 +24,7 @@ class Disk extends models['Resource'] { * that has the disk attached. * @member {object} [sku] * @member {string} [sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {string} [sku.tier] The sku tier. * @member {array} [zones] The Logical zone list for Disk. * @member {date} [timeCreated] The time when the disk was created. @@ -41,7 +41,7 @@ class Disk extends models['Resource'] { * different subscription * @member {object} [creationData.imageReference] Disk source information. * @member {string} [creationData.imageReference.id] A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * @member {number} [creationData.imageReference.lun] If the disk is created * from an image's data disk, this is an index that indicates which of the * data disks in the image to use. For OS disks, this field is null. @@ -78,6 +78,12 @@ class Disk extends models['Resource'] { * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing * to a key or secret in KeyVault * @member {string} [provisioningState] The disk provisioning state. + * @member {number} [diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * @member {number} [diskMBpsReadWrite] The bandwidth allowed for this disk; + * only settable for UltraSSD disks. MBps means millions of bytes per second + * - MB here uses the ISO notation, of powers of 10. */ constructor() { super(); @@ -218,6 +224,20 @@ class Disk extends models['Resource'] { type: { name: 'String' } + }, + diskIOPSReadWrite: { + required: false, + serializedName: 'properties.diskIOPSReadWrite', + type: { + name: 'Number' + } + }, + diskMBpsReadWrite: { + required: false, + serializedName: 'properties.diskMBpsReadWrite', + type: { + name: 'Number' + } } } } diff --git a/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js b/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js index a90094cd64..a33e93f831 100644 --- a/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js +++ b/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a Encryption Settings for a Disk * diff --git a/lib/services/computeManagement2/lib/models/diskInstanceView.js b/lib/services/computeManagement2/lib/models/diskInstanceView.js index 5350cc26c3..53b49e1f71 100644 --- a/lib/services/computeManagement2/lib/models/diskInstanceView.js +++ b/lib/services/computeManagement2/lib/models/diskInstanceView.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The instance view of the disk. * diff --git a/lib/services/computeManagement2/lib/models/diskSku.js b/lib/services/computeManagement2/lib/models/diskSku.js index f06042e1b9..bbe7a171ba 100644 --- a/lib/services/computeManagement2/lib/models/diskSku.js +++ b/lib/services/computeManagement2/lib/models/diskSku.js @@ -11,14 +11,15 @@ 'use strict'; /** - * The disks sku name. Can be Standard_LRS or Premium_LRS. + * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or + * UltraSSD_LRS. * */ class DiskSku { /** * Create a DiskSku. * @member {string} [name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {string} [tier] The sku tier. Default value: 'Standard' . */ constructor() { diff --git a/lib/services/computeManagement2/lib/models/diskUpdate.js b/lib/services/computeManagement2/lib/models/diskUpdate.js index a9899f37c5..8e023d33a8 100644 --- a/lib/services/computeManagement2/lib/models/diskUpdate.js +++ b/lib/services/computeManagement2/lib/models/diskUpdate.js @@ -10,14 +10,11 @@ 'use strict'; -const models = require('./index'); - /** * Disk update resource. * - * @extends models['ResourceUpdate'] */ -class DiskUpdate extends models['ResourceUpdate'] { +class DiskUpdate { /** * Create a DiskUpdate. * @member {string} [osType] the Operating System type. Possible values @@ -50,9 +47,19 @@ class DiskUpdate extends models['ResourceUpdate'] { * Resource Id * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing * to a key or secret in KeyVault + * @member {number} [diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * @member {number} [diskMBpsReadWrite] The bandwidth allowed for this disk; + * only settable for UltraSSD disks. MBps means millions of bytes per second + * - MB here uses the ISO notation, of powers of 10. + * @member {object} [tags] Resource tags + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' + * @member {string} [sku.tier] The sku tier. */ constructor() { - super(); } /** @@ -69,28 +76,6 @@ class DiskUpdate extends models['ResourceUpdate'] { name: 'Composite', className: 'DiskUpdate', modelProperties: { - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sku: { - required: false, - serializedName: 'sku', - type: { - name: 'Composite', - className: 'DiskSku' - } - }, osType: { required: false, serializedName: 'properties.osType', @@ -113,6 +98,42 @@ class DiskUpdate extends models['ResourceUpdate'] { name: 'Composite', className: 'EncryptionSettings' } + }, + diskIOPSReadWrite: { + required: false, + serializedName: 'properties.diskIOPSReadWrite', + type: { + name: 'Number' + } + }, + diskMBpsReadWrite: { + required: false, + serializedName: 'properties.diskMBpsReadWrite', + type: { + name: 'Number' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'DiskSku' + } } } } diff --git a/lib/services/computeManagement2/lib/models/encryptionSettings.js b/lib/services/computeManagement2/lib/models/encryptionSettings.js index 61dd97452c..53f476b2b7 100644 --- a/lib/services/computeManagement2/lib/models/encryptionSettings.js +++ b/lib/services/computeManagement2/lib/models/encryptionSettings.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Encryption settings for disk or snapshot * diff --git a/lib/services/computeManagement2/lib/models/gallery.js b/lib/services/computeManagement2/lib/models/gallery.js new file mode 100644 index 0000000000..2a046e2784 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/gallery.js @@ -0,0 +1,126 @@ +/* + * 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'); + +/** + * Specifies information about the Shared Image Gallery that you want to create + * or update. + * + * @extends models['Resource'] + */ +class Gallery extends models['Resource'] { + /** + * Create a Gallery. + * @member {string} [description] The description of this Shared Image + * Gallery resource. This property is updateable. + * @member {object} [identifier] + * @member {string} [identifier.uniqueName] The unique name of the Shared + * Image Gallery. This name is generated automatically by Azure. + * @member {string} [provisioningState] The current state of the gallery. The + * provisioning state, which only appears in the response. Possible values + * include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', + * 'Migrating' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Gallery + * + * @returns {object} metadata of Gallery + * + */ + mapper() { + return { + required: false, + serializedName: 'Gallery', + type: { + name: 'Composite', + className: 'Gallery', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + identifier: { + required: false, + serializedName: 'properties.identifier', + type: { + name: 'Composite', + className: 'GalleryIdentifier' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Gallery; diff --git a/lib/services/computeManagement2/lib/models/galleryArtifactPublishingProfileBase.js b/lib/services/computeManagement2/lib/models/galleryArtifactPublishingProfileBase.js new file mode 100644 index 0000000000..31822f68b5 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryArtifactPublishingProfileBase.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Describes the basic gallery artifact publishing profile. + * + */ +class GalleryArtifactPublishingProfileBase { + /** + * Create a GalleryArtifactPublishingProfileBase. + * @member {array} [targetRegions] The target regions where the Image Version + * is going to be replicated to. This property is updateable. + * @member {object} source + * @member {object} [source.managedImage] + * @member {string} [source.managedImage.id] The managed artifact id. + */ + constructor() { + } + + /** + * Defines the metadata of GalleryArtifactPublishingProfileBase + * + * @returns {object} metadata of GalleryArtifactPublishingProfileBase + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryArtifactPublishingProfileBase', + type: { + name: 'Composite', + className: 'GalleryArtifactPublishingProfileBase', + modelProperties: { + targetRegions: { + required: false, + serializedName: 'targetRegions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TargetRegionElementType', + type: { + name: 'Composite', + className: 'TargetRegion' + } + } + } + }, + source: { + required: true, + serializedName: 'source', + type: { + name: 'Composite', + className: 'GalleryArtifactSource' + } + } + } + } + }; + } +} + +module.exports = GalleryArtifactPublishingProfileBase; diff --git a/lib/services/computeManagement2/lib/models/galleryArtifactSource.js b/lib/services/computeManagement2/lib/models/galleryArtifactSource.js new file mode 100644 index 0000000000..d2bd4723e5 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryArtifactSource.js @@ -0,0 +1,54 @@ +/* + * 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 source image from which the Image Version is going to be created. + * + */ +class GalleryArtifactSource { + /** + * Create a GalleryArtifactSource. + * @member {object} managedImage + * @member {string} [managedImage.id] The managed artifact id. + */ + constructor() { + } + + /** + * Defines the metadata of GalleryArtifactSource + * + * @returns {object} metadata of GalleryArtifactSource + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryArtifactSource', + type: { + name: 'Composite', + className: 'GalleryArtifactSource', + modelProperties: { + managedImage: { + required: true, + serializedName: 'managedImage', + type: { + name: 'Composite', + className: 'ManagedArtifact' + } + } + } + } + }; + } +} + +module.exports = GalleryArtifactSource; diff --git a/lib/services/computeManagement2/lib/models/galleryDataDiskImage.js b/lib/services/computeManagement2/lib/models/galleryDataDiskImage.js new file mode 100644 index 0000000000..8ddf4e18fa --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryDataDiskImage.js @@ -0,0 +1,77 @@ +/* + * 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'); + +/** + * This is the data disk image. + * + * @extends models['GalleryDiskImage'] + */ +class GalleryDataDiskImage extends models['GalleryDiskImage'] { + /** + * Create a GalleryDataDiskImage. + * @member {number} [lun] This property specifies the logical unit number of + * the data disk. This value is used to identify data disks within the + * Virtual Machine and therefore must be unique for each data disk attached + * to the Virtual Machine. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GalleryDataDiskImage + * + * @returns {object} metadata of GalleryDataDiskImage + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryDataDiskImage', + type: { + name: 'Composite', + className: 'GalleryDataDiskImage', + modelProperties: { + sizeInGB: { + required: false, + readOnly: true, + serializedName: 'sizeInGB', + type: { + name: 'Number' + } + }, + hostCaching: { + required: false, + readOnly: true, + serializedName: 'hostCaching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + }, + lun: { + required: false, + readOnly: true, + serializedName: 'lun', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = GalleryDataDiskImage; diff --git a/lib/services/computeManagement2/lib/models/galleryDiskImage.js b/lib/services/computeManagement2/lib/models/galleryDiskImage.js new file mode 100644 index 0000000000..fb700c79dd --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryDiskImage.js @@ -0,0 +1,66 @@ +/* + * 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'; + +/** + * This is the disk image base class. + * + */ +class GalleryDiskImage { + /** + * Create a GalleryDiskImage. + * @member {number} [sizeInGB] This property indicates the size of the VHD to + * be created. + * @member {string} [hostCaching] The host caching of the disk. Valid values + * are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + */ + constructor() { + } + + /** + * Defines the metadata of GalleryDiskImage + * + * @returns {object} metadata of GalleryDiskImage + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryDiskImage', + type: { + name: 'Composite', + className: 'GalleryDiskImage', + modelProperties: { + sizeInGB: { + required: false, + readOnly: true, + serializedName: 'sizeInGB', + type: { + name: 'Number' + } + }, + hostCaching: { + required: false, + readOnly: true, + serializedName: 'hostCaching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + } + } + } + }; + } +} + +module.exports = GalleryDiskImage; diff --git a/lib/services/computeManagement2/lib/models/galleryIdentifier.js b/lib/services/computeManagement2/lib/models/galleryIdentifier.js new file mode 100644 index 0000000000..64371a28d8 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryIdentifier.js @@ -0,0 +1,54 @@ +/* + * 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'; + +/** + * Describes the gallery unique name. + * + */ +class GalleryIdentifier { + /** + * Create a GalleryIdentifier. + * @member {string} [uniqueName] The unique name of the Shared Image Gallery. + * This name is generated automatically by Azure. + */ + constructor() { + } + + /** + * Defines the metadata of GalleryIdentifier + * + * @returns {object} metadata of GalleryIdentifier + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryIdentifier', + type: { + name: 'Composite', + className: 'GalleryIdentifier', + modelProperties: { + uniqueName: { + required: false, + readOnly: true, + serializedName: 'uniqueName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GalleryIdentifier; diff --git a/lib/services/computeManagement2/lib/models/galleryImage.js b/lib/services/computeManagement2/lib/models/galleryImage.js new file mode 100644 index 0000000000..f1ebd775ab --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryImage.js @@ -0,0 +1,228 @@ +/* + * 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'); + +/** + * Specifies information about the gallery Image Definition that you want to + * create or update. + * + * @extends models['Resource'] + */ +class GalleryImage extends models['Resource'] { + /** + * Create a GalleryImage. + * @member {string} [description] The description of this gallery Image + * Definition resource. This property is updateable. + * @member {string} [eula] The Eula agreement for the gallery Image + * Definition. + * @member {string} [privacyStatementUri] The privacy statement uri. + * @member {string} [releaseNoteUri] The release note uri. + * @member {string} osType This property allows you to specify the type of + * the OS that is included in the disk when creating a VM from a managed + * image.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * @member {string} osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' + * @member {date} [endOfLifeDate] The end of life date of the gallery Image + * Definition. This property can be used for decommissioning purposes. This + * property is updateable. + * @member {object} identifier + * @member {string} [identifier.publisher] The name of the gallery Image + * Definition publisher. + * @member {string} [identifier.offer] The name of the gallery Image + * Definition offer. + * @member {string} [identifier.sku] The name of the gallery Image Definition + * SKU. + * @member {object} [recommended] + * @member {object} [recommended.vCPUs] + * @member {number} [recommended.vCPUs.min] The minimum number of the + * resource. + * @member {number} [recommended.vCPUs.max] The maximum number of the + * resource. + * @member {object} [recommended.memory] + * @member {number} [recommended.memory.min] The minimum number of the + * resource. + * @member {number} [recommended.memory.max] The maximum number of the + * resource. + * @member {object} [disallowed] + * @member {array} [disallowed.diskTypes] A list of disk types. + * @member {object} [purchasePlan] + * @member {string} [purchasePlan.name] The plan ID. + * @member {string} [purchasePlan.publisher] The publisher ID. + * @member {string} [purchasePlan.product] The product ID. + * @member {string} [provisioningState] The current state of the gallery + * Image Definition. The provisioning state, which only appears in the + * response. Possible values include: 'Creating', 'Updating', 'Failed', + * 'Succeeded', 'Deleting', 'Migrating' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GalleryImage + * + * @returns {object} metadata of GalleryImage + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryImage', + type: { + name: 'Composite', + className: 'GalleryImage', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + eula: { + required: false, + serializedName: 'properties.eula', + type: { + name: 'String' + } + }, + privacyStatementUri: { + required: false, + serializedName: 'properties.privacyStatementUri', + type: { + name: 'String' + } + }, + releaseNoteUri: { + required: false, + serializedName: 'properties.releaseNoteUri', + type: { + name: 'String' + } + }, + osType: { + required: true, + serializedName: 'properties.osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + osState: { + required: true, + serializedName: 'properties.osState', + type: { + name: 'Enum', + allowedValues: [ 'Generalized', 'Specialized' ] + } + }, + endOfLifeDate: { + required: false, + serializedName: 'properties.endOfLifeDate', + type: { + name: 'DateTime' + } + }, + identifier: { + required: true, + serializedName: 'properties.identifier', + type: { + name: 'Composite', + className: 'GalleryImageIdentifier' + } + }, + recommended: { + required: false, + serializedName: 'properties.recommended', + type: { + name: 'Composite', + className: 'RecommendedMachineConfiguration' + } + }, + disallowed: { + required: false, + serializedName: 'properties.disallowed', + type: { + name: 'Composite', + className: 'Disallowed' + } + }, + purchasePlan: { + required: false, + serializedName: 'properties.purchasePlan', + type: { + name: 'Composite', + className: 'ImagePurchasePlan' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GalleryImage; diff --git a/lib/services/computeManagement2/lib/models/galleryImageIdentifier.js b/lib/services/computeManagement2/lib/models/galleryImageIdentifier.js new file mode 100644 index 0000000000..533f30ce82 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryImageIdentifier.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'; + +/** + * This is the gallery Image Definition identifier. + * + */ +class GalleryImageIdentifier { + /** + * Create a GalleryImageIdentifier. + * @member {string} publisher The name of the gallery Image Definition + * publisher. + * @member {string} offer The name of the gallery Image Definition offer. + * @member {string} sku The name of the gallery Image Definition SKU. + */ + constructor() { + } + + /** + * Defines the metadata of GalleryImageIdentifier + * + * @returns {object} metadata of GalleryImageIdentifier + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryImageIdentifier', + type: { + name: 'Composite', + className: 'GalleryImageIdentifier', + modelProperties: { + publisher: { + required: true, + serializedName: 'publisher', + type: { + name: 'String' + } + }, + offer: { + required: true, + serializedName: 'offer', + type: { + name: 'String' + } + }, + sku: { + required: true, + serializedName: 'sku', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GalleryImageIdentifier; diff --git a/lib/services/computeManagement2/lib/models/galleryImageList.js b/lib/services/computeManagement2/lib/models/galleryImageList.js new file mode 100644 index 0000000000..fdafd72e76 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryImageList.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'; + +/** + * The List Gallery Images operation response. + */ +class GalleryImageList extends Array { + /** + * Create a GalleryImageList. + * @member {string} [nextLink] The uri to fetch the next page of Image + * Definitions in the Shared Image Gallery. Call ListNext() with this to + * fetch the next page of gallery Image Definitions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GalleryImageList + * + * @returns {object} metadata of GalleryImageList + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryImageList', + type: { + name: 'Composite', + className: 'GalleryImageList', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GalleryImageElementType', + type: { + name: 'Composite', + className: 'GalleryImage' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GalleryImageList; diff --git a/lib/services/computeManagement2/lib/models/galleryImageVersion.js b/lib/services/computeManagement2/lib/models/galleryImageVersion.js new file mode 100644 index 0000000000..bf7d6e7a72 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryImageVersion.js @@ -0,0 +1,156 @@ +/* + * 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'); + +/** + * Specifies information about the gallery Image Version that you want to + * create or update. + * + * @extends models['Resource'] + */ +class GalleryImageVersion extends models['Resource'] { + /** + * Create a GalleryImageVersion. + * @member {object} publishingProfile + * @member {number} [publishingProfile.replicaCount] The number of replicas + * of the Image Version to be created per region. This property would take + * effect for a region when regionalReplicaCount is not specified. This + * property is updateable. + * @member {boolean} [publishingProfile.excludeFromLatest] If set to true, + * Virtual Machines deployed from the latest version of the Image Definition + * won't use this Image Version. + * @member {date} [publishingProfile.publishedDate] The timestamp for when + * the gallery Image Version is published. + * @member {date} [publishingProfile.endOfLifeDate] The end of life date of + * the gallery Image Version. This property can be used for decommissioning + * purposes. This property is updateable. + * @member {string} [provisioningState] The current state of the gallery + * Image Version. The provisioning state, which only appears in the response. + * Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + * 'Deleting', 'Migrating' + * @member {object} [storageProfile] + * @member {object} [storageProfile.osDiskImage] + * @member {array} [storageProfile.dataDiskImages] A list of data disk + * images. + * @member {object} [replicationStatus] + * @member {string} [replicationStatus.aggregatedState] This is the + * aggregated replication status based on all the regional replication status + * flags. Possible values include: 'Unknown', 'InProgress', 'Completed', + * 'Failed' + * @member {array} [replicationStatus.summary] This is a summary of + * replication status for each region. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GalleryImageVersion + * + * @returns {object} metadata of GalleryImageVersion + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryImageVersion', + type: { + name: 'Composite', + className: 'GalleryImageVersion', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + publishingProfile: { + required: true, + serializedName: 'properties.publishingProfile', + type: { + name: 'Composite', + className: 'GalleryImageVersionPublishingProfile' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + storageProfile: { + required: false, + readOnly: true, + serializedName: 'properties.storageProfile', + type: { + name: 'Composite', + className: 'GalleryImageVersionStorageProfile' + } + }, + replicationStatus: { + required: false, + readOnly: true, + serializedName: 'properties.replicationStatus', + type: { + name: 'Composite', + className: 'ReplicationStatus' + } + } + } + } + }; + } +} + +module.exports = GalleryImageVersion; diff --git a/lib/services/computeManagement2/lib/models/galleryImageVersionList.js b/lib/services/computeManagement2/lib/models/galleryImageVersionList.js new file mode 100644 index 0000000000..959c808e30 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryImageVersionList.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'; + +/** + * The List Gallery Image version operation response. + */ +class GalleryImageVersionList extends Array { + /** + * Create a GalleryImageVersionList. + * @member {string} [nextLink] The uri to fetch the next page of gallery + * Image Versions. Call ListNext() with this to fetch the next page of + * gallery Image Versions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GalleryImageVersionList + * + * @returns {object} metadata of GalleryImageVersionList + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryImageVersionList', + type: { + name: 'Composite', + className: 'GalleryImageVersionList', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GalleryImageVersionElementType', + type: { + name: 'Composite', + className: 'GalleryImageVersion' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GalleryImageVersionList; diff --git a/lib/services/computeManagement2/lib/models/galleryImageVersionPublishingProfile.js b/lib/services/computeManagement2/lib/models/galleryImageVersionPublishingProfile.js new file mode 100644 index 0000000000..0db9f2a40b --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryImageVersionPublishingProfile.js @@ -0,0 +1,112 @@ +/* + * 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 publishing profile of a gallery Image Version. + * + * @extends models['GalleryArtifactPublishingProfileBase'] + */ +class GalleryImageVersionPublishingProfile extends models['GalleryArtifactPublishingProfileBase'] { + /** + * Create a GalleryImageVersionPublishingProfile. + * @member {number} [replicaCount] The number of replicas of the Image + * Version to be created per region. This property would take effect for a + * region when regionalReplicaCount is not specified. This property is + * updateable. + * @member {boolean} [excludeFromLatest] If set to true, Virtual Machines + * deployed from the latest version of the Image Definition won't use this + * Image Version. + * @member {date} [publishedDate] The timestamp for when the gallery Image + * Version is published. + * @member {date} [endOfLifeDate] The end of life date of the gallery Image + * Version. This property can be used for decommissioning purposes. This + * property is updateable. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GalleryImageVersionPublishingProfile + * + * @returns {object} metadata of GalleryImageVersionPublishingProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryImageVersionPublishingProfile', + type: { + name: 'Composite', + className: 'GalleryImageVersionPublishingProfile', + modelProperties: { + targetRegions: { + required: false, + serializedName: 'targetRegions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TargetRegionElementType', + type: { + name: 'Composite', + className: 'TargetRegion' + } + } + } + }, + source: { + required: true, + serializedName: 'source', + type: { + name: 'Composite', + className: 'GalleryArtifactSource' + } + }, + replicaCount: { + required: false, + serializedName: 'replicaCount', + type: { + name: 'Number' + } + }, + excludeFromLatest: { + required: false, + serializedName: 'excludeFromLatest', + type: { + name: 'Boolean' + } + }, + publishedDate: { + required: false, + readOnly: true, + serializedName: 'publishedDate', + type: { + name: 'DateTime' + } + }, + endOfLifeDate: { + required: false, + serializedName: 'endOfLifeDate', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = GalleryImageVersionPublishingProfile; diff --git a/lib/services/computeManagement2/lib/models/galleryImageVersionStorageProfile.js b/lib/services/computeManagement2/lib/models/galleryImageVersionStorageProfile.js new file mode 100644 index 0000000000..4cca270246 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryImageVersionStorageProfile.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * This is the storage profile of a gallery Image Version. + * + */ +class GalleryImageVersionStorageProfile { + /** + * Create a GalleryImageVersionStorageProfile. + * @member {object} [osDiskImage] + * @member {array} [dataDiskImages] A list of data disk images. + */ + constructor() { + } + + /** + * Defines the metadata of GalleryImageVersionStorageProfile + * + * @returns {object} metadata of GalleryImageVersionStorageProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryImageVersionStorageProfile', + type: { + name: 'Composite', + className: 'GalleryImageVersionStorageProfile', + modelProperties: { + osDiskImage: { + required: false, + readOnly: true, + serializedName: 'osDiskImage', + type: { + name: 'Composite', + className: 'GalleryOSDiskImage' + } + }, + dataDiskImages: { + required: false, + readOnly: true, + serializedName: 'dataDiskImages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GalleryDataDiskImageElementType', + type: { + name: 'Composite', + className: 'GalleryDataDiskImage' + } + } + } + } + } + } + }; + } +} + +module.exports = GalleryImageVersionStorageProfile; diff --git a/lib/services/computeManagement2/lib/models/galleryList.js b/lib/services/computeManagement2/lib/models/galleryList.js new file mode 100644 index 0000000000..3d28a0c7fe --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryList.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'; + +/** + * The List Galleries operation response. + */ +class GalleryList extends Array { + /** + * Create a GalleryList. + * @member {string} [nextLink] The uri to fetch the next page of galleries. + * Call ListNext() with this to fetch the next page of galleries. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GalleryList + * + * @returns {object} metadata of GalleryList + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryList', + type: { + name: 'Composite', + className: 'GalleryList', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GalleryElementType', + type: { + name: 'Composite', + className: 'Gallery' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GalleryList; diff --git a/lib/services/computeManagement2/lib/models/galleryOSDiskImage.js b/lib/services/computeManagement2/lib/models/galleryOSDiskImage.js new file mode 100644 index 0000000000..5709eb2a9b --- /dev/null +++ b/lib/services/computeManagement2/lib/models/galleryOSDiskImage.js @@ -0,0 +1,65 @@ +/* + * 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'); + +/** + * This is the OS disk image. + * + * @extends models['GalleryDiskImage'] + */ +class GalleryOSDiskImage extends models['GalleryDiskImage'] { + /** + * Create a GalleryOSDiskImage. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GalleryOSDiskImage + * + * @returns {object} metadata of GalleryOSDiskImage + * + */ + mapper() { + return { + required: false, + serializedName: 'GalleryOSDiskImage', + type: { + name: 'Composite', + className: 'GalleryOSDiskImage', + modelProperties: { + sizeInGB: { + required: false, + readOnly: true, + serializedName: 'sizeInGB', + type: { + name: 'Number' + } + }, + hostCaching: { + required: false, + readOnly: true, + serializedName: 'hostCaching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + } + } + } + }; + } +} + +module.exports = GalleryOSDiskImage; diff --git a/lib/services/computeManagement2/lib/models/image.js b/lib/services/computeManagement2/lib/models/image.js index 50e1764899..ef96bab47d 100644 --- a/lib/services/computeManagement2/lib/models/image.js +++ b/lib/services/computeManagement2/lib/models/image.js @@ -52,9 +52,9 @@ class Image extends models['Resource'] { * name of the disk in a virtual machine image.

This value cannot be * larger than 1023 GB * @member {string} [storageProfile.osDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * storage account type for the managed disk. UltraSSD_LRS cannot be used + * with OS Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that * are used to add a data disk to a virtual machine.

For more * information about disks, see [About disks and VHDs for Azure virtual diff --git a/lib/services/computeManagement2/lib/models/imageDataDisk.js b/lib/services/computeManagement2/lib/models/imageDataDisk.js index 1c4c5e7d30..3042858ae8 100644 --- a/lib/services/computeManagement2/lib/models/imageDataDisk.js +++ b/lib/services/computeManagement2/lib/models/imageDataDisk.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a data disk. * @@ -36,8 +34,9 @@ class ImageDataDisk { * gigabytes. This element can be used to overwrite the name of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {string} [storageAccountType] Specifies the storage account type - * for the managed disk. Possible values are: Standard_LRS or Premium_LRS. - * Possible values include: 'Standard_LRS', 'Premium_LRS' + * for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, + * it cannot be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ constructor() { } diff --git a/lib/services/computeManagement2/lib/models/imageDiskReference.js b/lib/services/computeManagement2/lib/models/imageDiskReference.js index 18d5045692..60268c8983 100644 --- a/lib/services/computeManagement2/lib/models/imageDiskReference.js +++ b/lib/services/computeManagement2/lib/models/imageDiskReference.js @@ -17,7 +17,7 @@ class ImageDiskReference { /** * Create a ImageDiskReference. - * @member {string} id A relative uri containing either a Platform Imgage + * @member {string} id A relative uri containing either a Platform Image * Repository or user image reference. * @member {number} [lun] If the disk is created from an image's data disk, * this is an index that indicates which of the data disks in the image to diff --git a/lib/services/computeManagement2/lib/models/imageOSDisk.js b/lib/services/computeManagement2/lib/models/imageOSDisk.js index 2e3abc90ec..6dfa53bee5 100644 --- a/lib/services/computeManagement2/lib/models/imageOSDisk.js +++ b/lib/services/computeManagement2/lib/models/imageOSDisk.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes an Operating System disk. * @@ -39,8 +37,9 @@ class ImageOSDisk { * gigabytes. This element can be used to overwrite the name of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {string} [storageAccountType] Specifies the storage account type - * for the managed disk. Possible values are: Standard_LRS or Premium_LRS. - * Possible values include: 'Standard_LRS', 'Premium_LRS' + * for the managed disk. UltraSSD_LRS cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' */ constructor() { } diff --git a/lib/services/computeManagement2/lib/models/imagePurchasePlan.js b/lib/services/computeManagement2/lib/models/imagePurchasePlan.js new file mode 100644 index 0000000000..cd2aeaf85d --- /dev/null +++ b/lib/services/computeManagement2/lib/models/imagePurchasePlan.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'; + +/** + * Describes the gallery Image Definition purchase plan. This is used by + * marketplace images. + * + */ +class ImagePurchasePlan { + /** + * Create a ImagePurchasePlan. + * @member {string} [name] The plan ID. + * @member {string} [publisher] The publisher ID. + * @member {string} [product] The product ID. + */ + constructor() { + } + + /** + * Defines the metadata of ImagePurchasePlan + * + * @returns {object} metadata of ImagePurchasePlan + * + */ + mapper() { + return { + required: false, + serializedName: 'ImagePurchasePlan', + type: { + name: 'Composite', + className: 'ImagePurchasePlan', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + publisher: { + required: false, + serializedName: 'publisher', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'product', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ImagePurchasePlan; diff --git a/lib/services/computeManagement2/lib/models/imageStorageProfile.js b/lib/services/computeManagement2/lib/models/imageStorageProfile.js index 1d36d1e724..354a80a67f 100644 --- a/lib/services/computeManagement2/lib/models/imageStorageProfile.js +++ b/lib/services/computeManagement2/lib/models/imageStorageProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a storage profile. * @@ -44,8 +42,9 @@ class ImageStorageProfile { * disk in a virtual machine image.

This value cannot be larger than * 1023 GB * @member {string} [osDisk.storageAccountType] Specifies the storage account - * type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * type for the managed disk. UltraSSD_LRS cannot be used with OS Disk. + * Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [dataDisks] Specifies the parameters that are used to add * a data disk to a virtual machine.

For more information about * disks, see [About disks and VHDs for Azure virtual diff --git a/lib/services/computeManagement2/lib/models/imageUpdate.js b/lib/services/computeManagement2/lib/models/imageUpdate.js index 16ea2a9ac7..684d4b0221 100644 --- a/lib/services/computeManagement2/lib/models/imageUpdate.js +++ b/lib/services/computeManagement2/lib/models/imageUpdate.js @@ -13,9 +13,7 @@ const models = require('./index'); /** - * The source user image virtual hard disk. The virtual hard disk will be - * copied before being attached to the virtual machine. If SourceImage is - * provided, the destination virtual hard drive must not exist. + * The source user image virtual hard disk. Only tags may be updated. * * @extends models['UpdateResource'] */ @@ -52,9 +50,9 @@ class ImageUpdate extends models['UpdateResource'] { * name of the disk in a virtual machine image.

This value cannot be * larger than 1023 GB * @member {string} [storageProfile.osDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * storage account type for the managed disk. UltraSSD_LRS cannot be used + * with OS Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that * are used to add a data disk to a virtual machine.

For more * information about disks, see [About disks and VHDs for Azure virtual diff --git a/lib/services/computeManagement2/lib/models/index.d.ts b/lib/services/computeManagement2/lib/models/index.d.ts index e1e00fc3f7..aebf09e1af 100644 --- a/lib/services/computeManagement2/lib/models/index.d.ts +++ b/lib/services/computeManagement2/lib/models/index.d.ts @@ -130,7 +130,10 @@ export interface Resource extends BaseResource { * @member {array} [virtualMachines] A list of references to all virtual * machines in the availability set. * @member {array} [statuses] The resource status information. - * @member {object} [sku] Sku of the availability set + * @member {object} [sku] Sku of the availability set, only name is required to + * be set. See AvailabilitySetSkuTypes for possible set of values. Use + * 'Aligned' for virtual machines with managed disks and 'Classic' for virtual + * machines with unmanaged disks. Default value is 'Classic'. * @member {string} [sku.name] The sku name. * @member {string} [sku.tier] Specifies the tier of virtual machines in a * scale set.

Possible Values:

**Standard**

@@ -163,15 +166,7 @@ export interface UpdateResource extends BaseResource { * Initializes a new instance of the AvailabilitySetUpdate class. * @constructor * Specifies information about the availability set that the virtual machine - * should be assigned to. Virtual machines specified in the same availability - * set are allocated to different nodes to maximize availability. For more - * information about availability sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * should be assigned to. Only tags may be updated. * * @member {number} [platformUpdateDomainCount] Update Domain count. * @member {number} [platformFaultDomainCount] Fault Domain count. @@ -501,12 +496,19 @@ export interface VirtualMachineCaptureParameters { * @class * Initializes a new instance of the VirtualMachineCaptureResult class. * @constructor - * Resource Id. + * Output of virtual machine capture operation. * - * @member {object} [output] Operation output data (raw JSON) + * @member {string} [schema] the schema of the captured virtual machine + * @member {string} [contentVersion] the version of the content + * @member {object} [parameters] parameters of the captured virtual machine + * @member {array} [resources] a list of resource items of the captured virtual + * machine */ export interface VirtualMachineCaptureResult extends SubResource { - output?: any; + readonly schema?: string; + readonly contentVersion?: string; + readonly parameters?: any; + readonly resources?: any[]; } /** @@ -702,6 +704,21 @@ export interface VirtualHardDisk { uri?: string; } +/** + * @class + * Initializes a new instance of the DiffDiskSettings class. + * @constructor + * Describes the parameters of differencing disk settings that can be be + * specified for operating system disk.

NOTE: The differencing disk + * settings can only be specified for managed disk. + * + * @member {string} [option] Specifies the differencing disk settings for + * operating system disk. Possible values include: 'Local' + */ +export interface DiffDiskSettings { + option?: string; +} + /** * @class * Initializes a new instance of the ManagedDiskParameters class. @@ -709,8 +726,9 @@ export interface VirtualHardDisk { * The parameters of a managed disk. * * @member {string} [storageAccountType] Specifies the storage account type for - * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible - * values include: 'Standard_LRS', 'Premium_LRS' + * the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it + * cannot be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface ManagedDiskParameters extends SubResource { storageAccountType?: string; @@ -763,6 +781,10 @@ export interface ManagedDiskParameters extends SubResource { * Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' * @member {boolean} [writeAcceleratorEnabled] Specifies whether * writeAccelerator should be enabled or disabled on the disk. + * @member {object} [diffDiskSettings] Specifies the differencing Disk Settings + * for the operating system disk used by the virtual machine. + * @member {string} [diffDiskSettings.option] Specifies the differencing disk + * settings for operating system disk. Possible values include: 'Local' * @member {string} createOption Specifies how the virtual machine should be * created.

Possible values are:

**Attach** \u2013 This value * is used when you are using a specialized disk to create the virtual @@ -772,12 +794,13 @@ export interface ManagedDiskParameters extends SubResource { * marketplace image, you also use the plan element previously described. * Possible values include: 'FromImage', 'Empty', 'Attach' * @member {number} [diskSizeGB] Specifies the size of an empty data disk in - * gigabytes. This element can be used to overwrite the name of the disk in a + * gigabytes. This element can be used to overwrite the size of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used with + * data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface OSDisk { osType?: string; @@ -787,6 +810,7 @@ export interface OSDisk { image?: VirtualHardDisk; caching?: string; writeAcceleratorEnabled?: boolean; + diffDiskSettings?: DiffDiskSettings; createOption: string; diskSizeGB?: number; managedDisk?: ManagedDiskParameters; @@ -824,12 +848,13 @@ export interface OSDisk { * marketplace image, you also use the plan element previously described. * Possible values include: 'FromImage', 'Empty', 'Attach' * @member {number} [diskSizeGB] Specifies the size of an empty data disk in - * gigabytes. This element can be used to overwrite the name of the disk in a + * gigabytes. This element can be used to overwrite the size of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used with + * data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface DataDisk { lun: number; @@ -908,6 +933,10 @@ export interface DataDisk { * 'ReadWrite' * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether * writeAccelerator should be enabled or disabled on the disk. + * @member {object} [osDisk.diffDiskSettings] Specifies the differencing Disk + * Settings for the operating system disk used by the virtual machine. + * @member {string} [osDisk.diffDiskSettings.option] Specifies the differencing + * disk settings for operating system disk. Possible values include: 'Local' * @member {string} [osDisk.createOption] Specifies how the virtual machine * should be created.

Possible values are:

**Attach** \u2013 * This value is used when you are using a specialized disk to create the @@ -917,13 +946,14 @@ export interface DataDisk { * you are using a marketplace image, you also use the plan element previously * described. Possible values include: 'FromImage', 'Empty', 'Attach' * @member {number} [osDisk.diskSizeGB] Specifies the size of an empty data - * disk in gigabytes. This element can be used to overwrite the name of the + * disk in gigabytes. This element can be used to overwrite the size of the * disk in a virtual machine image.

This value cannot be larger than * 1023 GB * @member {object} [osDisk.managedDisk] The managed disk parameters. * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: Standard_LRS - * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * storage account type for the managed disk. NOTE: UltraSSD_LRS can only be + * used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [dataDisks] Specifies the parameters that are used to add a * data disk to a virtual machine.

For more information about disks, * see [About disks and VHDs for Azure virtual @@ -935,6 +965,23 @@ export interface StorageProfile { dataDisks?: DataDisk[]; } +/** + * @class + * Initializes a new instance of the AdditionalCapabilities class. + * @constructor + * Enables or disables a capability on the virtual machine or virtual machine + * scale set. + * + * @member {boolean} [ultraSSDEnabled] The flag that enables or disables a + * capability to have one or more managed data disks with UltraSSD_LRS storage + * account type on the VM or VMSS. Managed disks with storage account type + * UltraSSD_LRS can be added to a virtual machine or virtual machine scale set + * only if this property is enabled. + */ +export interface AdditionalCapabilities { + ultraSSDEnabled?: boolean; +} + /** * @class * Initializes a new instance of the AdditionalUnattendContent class. @@ -1080,10 +1127,16 @@ export interface SshConfiguration { * @member {object} [ssh] Specifies the ssh key configuration for a Linux OS. * @member {array} [ssh.publicKeys] The list of SSH public keys used to * authenticate with linux based VMs. + * @member {boolean} [provisionVMAgent] Indicates whether virtual machine agent + * should be provisioned on the virtual machine.

When this property is + * not specified in the request body, default behavior is to set it to true. + * This will ensure that VM Agent is installed on the VM so that extensions can + * be added to the VM later. */ export interface LinuxConfiguration { disablePasswordAuthentication?: boolean; ssh?: SshConfiguration; + provisionVMAgent?: boolean; } /** @@ -1208,8 +1261,16 @@ export interface VaultSecretGroup { * configuration for a Linux OS. * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public * keys used to authenticate with linux based VMs. + * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine.

+ * When this property is not specified in the request body, default behavior is + * to set it to true. This will ensure that VM Agent is installed on the VM so + * that extensions can be added to the VM later. * @member {array} [secrets] Specifies set of certificates that should be * installed onto the virtual machine. + * @member {boolean} [allowExtensionOperations] Specifies whether extension + * operations should be allowed on the virtual machine.

This may only + * be set to False when no extensions are present on the virtual machine. */ export interface OSProfile { computerName?: string; @@ -1219,6 +1280,7 @@ export interface OSProfile { windowsConfiguration?: WindowsConfiguration; linuxConfiguration?: LinuxConfiguration; secrets?: VaultSecretGroup[]; + allowExtensionOperations?: boolean; } /** @@ -1252,9 +1314,8 @@ export interface NetworkProfile { * Initializes a new instance of the BootDiagnostics class. * @constructor * Boot Diagnostics is a debugging feature which allows you to view Console - * Output and Screenshot to diagnose VM status.

For Linux Virtual - * Machines, you can easily view the output of your console log.

For - * both Windows and Linux virtual machines, Azure also enables you to see a + * Output and Screenshot to diagnose VM status.

You can easily view + * the output of your console log.

Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @member {boolean} [enabled] Whether boot diagnostics should be enabled on @@ -1276,9 +1337,9 @@ export interface BootDiagnostics { * * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature * which allows you to view Console Output and Screenshot to diagnose VM - * status.

For Linux Virtual Machines, you can easily view the output - * of your console log.

For both Windows and Linux virtual machines, - * Azure also enables you to see a screenshot of the VM from the hypervisor. + * status.

You can easily view the output of your console log. + *

Azure also enables you to see a screenshot of the VM from the + * hypervisor. * @member {boolean} [bootDiagnostics.enabled] Whether boot diagnostics should * be enabled on the Virtual Machine. * @member {string} [bootDiagnostics.storageUri] Uri of the storage account to @@ -1357,10 +1418,34 @@ export interface DiskInstanceView { * @member {string} [consoleScreenshotBlobUri] The console screenshot blob URI. * @member {string} [serialConsoleLogBlobUri] The Linux serial console log blob * Uri. + * @member {object} [status] The boot diagnostics status information for the + * VM.

NOTE: It will be set only if there are errors encountered in + * enabling boot diagnostics. + * @member {string} [status.code] The status code. + * @member {string} [status.level] The level code. Possible values include: + * 'Info', 'Warning', 'Error' + * @member {string} [status.displayStatus] The short localizable label for the + * status. + * @member {string} [status.message] The detailed status message, including for + * alerts and error messages. + * @member {date} [status.time] The time of the status. */ export interface BootDiagnosticsInstanceView { - consoleScreenshotBlobUri?: string; - serialConsoleLogBlobUri?: string; + readonly consoleScreenshotBlobUri?: string; + readonly serialConsoleLogBlobUri?: string; + readonly status?: InstanceViewStatus; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineIdentityUserAssignedIdentitiesValue class. + * @constructor + * @member {string} [principalId] The principal id of user assigned identity. + * @member {string} [clientId] The client id of user assigned identity. + */ +export interface VirtualMachineIdentityUserAssignedIdentitiesValue { + readonly principalId?: string; + readonly clientId?: string; } /** @@ -1378,16 +1463,16 @@ export interface BootDiagnosticsInstanceView { * identity and a set of user assigned identities. The type 'None' will remove * any identities from the virtual machine. Possible values include: * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - * @member {array} [identityIds] The list of user identities associated with - * the Virtual Machine. The user identity references will be ARM resource ids - * in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [userAssignedIdentities] The list of user identities + * associated with the Virtual Machine. The user identity dictionary key + * references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ export interface VirtualMachineIdentity { readonly principalId?: string; readonly tenantId?: string; type?: string; - identityIds?: string[]; + userAssignedIdentities?: { [propertyName: string]: VirtualMachineIdentityUserAssignedIdentitiesValue }; } /** @@ -1466,13 +1551,24 @@ export interface MaintenanceRedeployStatus { * @member {array} [extensions] The extensions information. * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature * which allows you to view Console Output and Screenshot to diagnose VM - * status.

For Linux Virtual Machines, you can easily view the output - * of your console log.

For both Windows and Linux virtual machines, - * Azure also enables you to see a screenshot of the VM from the hypervisor. + * status.

You can easily view the output of your console log. + *

Azure also enables you to see a screenshot of the VM from the + * hypervisor. * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console * screenshot blob URI. * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial * console log blob Uri. + * @member {object} [bootDiagnostics.status] The boot diagnostics status + * information for the VM.

NOTE: It will be set only if there are + * errors encountered in enabling boot diagnostics. + * @member {string} [bootDiagnostics.status.code] The status code. + * @member {string} [bootDiagnostics.status.level] The level code. Possible + * values include: 'Info', 'Warning', 'Error' + * @member {string} [bootDiagnostics.status.displayStatus] The short + * localizable label for the status. + * @member {string} [bootDiagnostics.status.message] The detailed status + * message, including for alerts and error messages. + * @member {date} [bootDiagnostics.status.time] The time of the status. * @member {array} [statuses] The resource status information. */ export interface VirtualMachineInstanceView { @@ -1640,6 +1736,12 @@ export interface VirtualMachineInstanceView { * 'ReadOnly', 'ReadWrite' * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies * whether writeAccelerator should be enabled or disabled on the disk. + * @member {object} [storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the virtual + * machine. + * @member {string} [storageProfile.osDisk.diffDiskSettings.option] Specifies + * the differencing disk settings for operating system disk. Possible values + * include: 'Local' * @member {string} [storageProfile.osDisk.createOption] Specifies how the * virtual machine should be created.

Possible values are:

* **Attach** \u2013 This value is used when you are using a specialized disk @@ -1650,19 +1752,27 @@ export interface VirtualMachineInstanceView { * previously described. Possible values include: 'FromImage', 'Empty', * 'Attach' * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an - * empty data disk in gigabytes. This element can be used to overwrite the name + * empty data disk in gigabytes. This element can be used to overwrite the size * of the disk in a virtual machine image.

This value cannot be larger * than 1023 GB * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that are * used to add a data disk to a virtual machine.

For more information * about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [additionalCapabilities] Specifies additional capabilities + * enabled or disabled on the virtual machine. + * @member {boolean} [additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks with + * UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with + * storage account type UltraSSD_LRS can be added to a virtual machine or + * virtual machine scale set only if this property is enabled. * @member {object} [osProfile] Specifies the operating system settings for the * virtual machine. * @member {string} [osProfile.computerName] Specifies the host OS name of the @@ -1738,8 +1848,17 @@ export interface VirtualMachineInstanceView { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machine. + * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether + * extension operations should be allowed on the virtual machine.

This + * may only be set to False when no extensions are present on the virtual + * machine. * @member {object} [networkProfile] Specifies the network interfaces of the * virtual machine. * @member {array} [networkProfile.networkInterfaces] Specifies the list of @@ -1748,9 +1867,8 @@ export interface VirtualMachineInstanceView { * state.

Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot to - * diagnose VM status.

For Linux Virtual Machines, you can easily view - * the output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * diagnose VM status.

You can easily view the output of your console + * log.

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. @@ -1819,14 +1937,25 @@ export interface VirtualMachineInstanceView { * @member {array} [instanceView.extensions] The extensions information. * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot to - * diagnose VM status.

For Linux Virtual Machines, you can easily view - * the output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * diagnose VM status.

You can easily view the output of your console + * log.

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] The * console screenshot blob URI. * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The * Linux serial console log blob Uri. + * @member {object} [instanceView.bootDiagnostics.status] The boot diagnostics + * status information for the VM.

NOTE: It will be set only if there + * are errors encountered in enabling boot diagnostics. + * @member {string} [instanceView.bootDiagnostics.status.code] The status code. + * @member {string} [instanceView.bootDiagnostics.status.level] The level code. + * Possible values include: 'Info', 'Warning', 'Error' + * @member {string} [instanceView.bootDiagnostics.status.displayStatus] The + * short localizable label for the status. + * @member {string} [instanceView.bootDiagnostics.status.message] The detailed + * status message, including for alerts and error messages. + * @member {date} [instanceView.bootDiagnostics.status.time] The time of the + * status. * @member {array} [instanceView.statuses] The resource status information. * @member {string} [licenseType] Specifies that the image or disk that is * being used was licensed on-premises. This element is only used for images @@ -1854,16 +1983,17 @@ export interface VirtualMachineInstanceView { * created identity and a set of user assigned identities. The type 'None' will * remove any identities from the virtual machine. Possible values include: * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - * @member {array} [identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the Virtual Machine. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * @member {array} [zones] The virtual machine zones. */ export interface VirtualMachine extends Resource { plan?: Plan; hardwareProfile?: HardwareProfile; storageProfile?: StorageProfile; + additionalCapabilities?: AdditionalCapabilities; osProfile?: OSProfile; networkProfile?: NetworkProfile; diagnosticsProfile?: DiagnosticsProfile; @@ -1881,7 +2011,7 @@ export interface VirtualMachine extends Resource { * @class * Initializes a new instance of the VirtualMachineUpdate class. * @constructor - * Describes a Virtual Machine. + * Describes a Virtual Machine Update. * * @member {object} [plan] Specifies information about the marketplace image * used to create the virtual machine. This element is only used for @@ -2027,6 +2157,12 @@ export interface VirtualMachine extends Resource { * 'ReadOnly', 'ReadWrite' * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies * whether writeAccelerator should be enabled or disabled on the disk. + * @member {object} [storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the virtual + * machine. + * @member {string} [storageProfile.osDisk.diffDiskSettings.option] Specifies + * the differencing disk settings for operating system disk. Possible values + * include: 'Local' * @member {string} [storageProfile.osDisk.createOption] Specifies how the * virtual machine should be created.

Possible values are:

* **Attach** \u2013 This value is used when you are using a specialized disk @@ -2037,19 +2173,27 @@ export interface VirtualMachine extends Resource { * previously described. Possible values include: 'FromImage', 'Empty', * 'Attach' * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an - * empty data disk in gigabytes. This element can be used to overwrite the name + * empty data disk in gigabytes. This element can be used to overwrite the size * of the disk in a virtual machine image.

This value cannot be larger * than 1023 GB * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that are * used to add a data disk to a virtual machine.

For more information * about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [additionalCapabilities] Specifies additional capabilities + * enabled or disabled on the virtual machine. + * @member {boolean} [additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks with + * UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with + * storage account type UltraSSD_LRS can be added to a virtual machine or + * virtual machine scale set only if this property is enabled. * @member {object} [osProfile] Specifies the operating system settings for the * virtual machine. * @member {string} [osProfile.computerName] Specifies the host OS name of the @@ -2125,8 +2269,17 @@ export interface VirtualMachine extends Resource { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machine. + * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether + * extension operations should be allowed on the virtual machine.

This + * may only be set to False when no extensions are present on the virtual + * machine. * @member {object} [networkProfile] Specifies the network interfaces of the * virtual machine. * @member {array} [networkProfile.networkInterfaces] Specifies the list of @@ -2135,9 +2288,8 @@ export interface VirtualMachine extends Resource { * state.

Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot to - * diagnose VM status.

For Linux Virtual Machines, you can easily view - * the output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * diagnose VM status.

You can easily view the output of your console + * log.

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. @@ -2206,14 +2358,25 @@ export interface VirtualMachine extends Resource { * @member {array} [instanceView.extensions] The extensions information. * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot to - * diagnose VM status.

For Linux Virtual Machines, you can easily view - * the output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * diagnose VM status.

You can easily view the output of your console + * log.

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] The * console screenshot blob URI. * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The * Linux serial console log blob Uri. + * @member {object} [instanceView.bootDiagnostics.status] The boot diagnostics + * status information for the VM.

NOTE: It will be set only if there + * are errors encountered in enabling boot diagnostics. + * @member {string} [instanceView.bootDiagnostics.status.code] The status code. + * @member {string} [instanceView.bootDiagnostics.status.level] The level code. + * Possible values include: 'Info', 'Warning', 'Error' + * @member {string} [instanceView.bootDiagnostics.status.displayStatus] The + * short localizable label for the status. + * @member {string} [instanceView.bootDiagnostics.status.message] The detailed + * status message, including for alerts and error messages. + * @member {date} [instanceView.bootDiagnostics.status.time] The time of the + * status. * @member {array} [instanceView.statuses] The resource status information. * @member {string} [licenseType] Specifies that the image or disk that is * being used was licensed on-premises. This element is only used for images @@ -2240,16 +2403,17 @@ export interface VirtualMachine extends Resource { * created identity and a set of user assigned identities. The type 'None' will * remove any identities from the virtual machine. Possible values include: * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - * @member {array} [identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the Virtual Machine. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * @member {array} [zones] The virtual machine zones. */ export interface VirtualMachineUpdate extends UpdateResource { plan?: Plan; hardwareProfile?: HardwareProfile; storageProfile?: StorageProfile; + additionalCapabilities?: AdditionalCapabilities; osProfile?: OSProfile; networkProfile?: NetworkProfile; diagnosticsProfile?: DiagnosticsProfile; @@ -2262,6 +2426,23 @@ export interface VirtualMachineUpdate extends UpdateResource { zones?: string[]; } +/** + * @class + * Initializes a new instance of the AutomaticOSUpgradePolicy class. + * @constructor + * The configuration parameters used for performing automatic OS upgrade. + * + * @member {boolean} [enableAutomaticOSUpgrade] Whether OS upgrades should + * automatically be applied to scale set instances in a rolling fashion when a + * newer version of the image becomes available. Default value is false. + * @member {boolean} [disableAutomaticRollback] Whether OS image rollback + * feature should be disabled. Default value is false. + */ +export interface AutomaticOSUpgradePolicy { + enableAutomaticOSUpgrade?: boolean; + disableAutomaticRollback?: boolean; +} + /** * @class * Initializes a new instance of the RollingUpgradePolicy class. @@ -2333,14 +2514,20 @@ export interface RollingUpgradePolicy { * time between completing the update for all virtual machines in one batch and * starting the next batch. The time duration should be specified in ISO 8601 * format. The default value is 0 seconds (PT0S). - * @member {boolean} [automaticOSUpgrade] Whether OS upgrades should - * automatically be applied to scale set instances in a rolling fashion when a - * newer version of the image becomes available. + * @member {object} [automaticOSUpgradePolicy] Configuration parameters used + * for performing automatic OS Upgrade. + * @member {boolean} [automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * @member {boolean} [automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. */ export interface UpgradePolicy { mode?: string; rollingUpgradePolicy?: RollingUpgradePolicy; - automaticOSUpgrade?: boolean; + automaticOSUpgradePolicy?: AutomaticOSUpgradePolicy; } /** @@ -2368,8 +2555,8 @@ export interface UpgradePolicy { * gigabytes. This element can be used to overwrite the name of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {string} [storageAccountType] Specifies the storage account type for - * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible - * values include: 'Standard_LRS', 'Premium_LRS' + * the managed disk. UltraSSD_LRS cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface ImageOSDisk { osType: string; @@ -2404,8 +2591,9 @@ export interface ImageOSDisk { * gigabytes. This element can be used to overwrite the name of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {string} [storageAccountType] Specifies the storage account type for - * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible - * values include: 'Standard_LRS', 'Premium_LRS' + * the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it + * cannot be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface ImageDataDisk { lun: number; @@ -2447,8 +2635,9 @@ export interface ImageDataDisk { * in gigabytes. This element can be used to overwrite the name of the disk in * a virtual machine image.

This value cannot be larger than 1023 GB * @member {string} [osDisk.storageAccountType] Specifies the storage account - * type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. - * Possible values include: 'Standard_LRS', 'Premium_LRS' + * type for the managed disk. UltraSSD_LRS cannot be used with OS Disk. + * Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [dataDisks] Specifies the parameters that are used to add a * data disk to a virtual machine.

For more information about disks, * see [About disks and VHDs for Azure virtual @@ -2501,8 +2690,9 @@ export interface ImageStorageProfile { * name of the disk in a virtual machine image.

This value cannot be * larger than 1023 GB * @member {string} [storageProfile.osDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: Standard_LRS - * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * storage account type for the managed disk. UltraSSD_LRS cannot be used with + * OS Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that are * used to add a data disk to a virtual machine.

For more information * about disks, see [About disks and VHDs for Azure virtual @@ -2522,9 +2712,7 @@ export interface Image extends Resource { * @class * Initializes a new instance of the ImageUpdate class. * @constructor - * The source user image virtual hard disk. The virtual hard disk will be - * copied before being attached to the virtual machine. If SourceImage is - * provided, the destination virtual hard drive must not exist. + * The source user image virtual hard disk. Only tags may be updated. * * @member {object} [sourceVirtualMachine] The source virtual machine from * which Image is created. @@ -2556,8 +2744,9 @@ export interface Image extends Resource { * name of the disk in a virtual machine image.

This value cannot be * larger than 1023 GB * @member {string} [storageProfile.osDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: Standard_LRS - * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * storage account type for the managed disk. UltraSSD_LRS cannot be used with + * OS Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that are * used to add a data disk to a virtual machine.

For more information * about disks, see [About disks and VHDs for Azure virtual @@ -2573,6 +2762,18 @@ export interface ImageUpdate extends UpdateResource { readonly provisioningState?: string; } +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue class. + * @constructor + * @member {string} [principalId] The principal id of user assigned identity. + * @member {string} [clientId] The client id of user assigned identity. + */ +export interface VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue { + readonly principalId?: string; + readonly clientId?: string; +} + /** * @class * Initializes a new instance of the VirtualMachineScaleSetIdentity class. @@ -2591,16 +2792,16 @@ export interface ImageUpdate extends UpdateResource { * 'None' will remove any identities from the virtual machine scale set. * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, * UserAssigned', 'None' - * @member {array} [identityIds] The list of user identities associated with - * the virtual machine scale set. The user identity references will be ARM - * resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [userAssignedIdentities] The list of user identities + * associated with the virtual machine scale set. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ export interface VirtualMachineScaleSetIdentity { readonly principalId?: string; readonly tenantId?: string; type?: string; - identityIds?: string[]; + userAssignedIdentities?: { [propertyName: string]: VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue }; } /** @@ -2678,6 +2879,11 @@ export interface VirtualMachineScaleSetIdentity { * configuration for a Linux OS. * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public * keys used to authenticate with linux based VMs. + * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine.

+ * When this property is not specified in the request body, default behavior is + * to set it to true. This will ensure that VM Agent is installed on the VM so + * that extensions can be added to the VM later. * @member {array} [secrets] Specifies set of certificates that should be * installed onto the virtual machines in the scale set. */ @@ -2724,6 +2930,11 @@ export interface VirtualMachineScaleSetOSProfile { * configuration for a Linux OS. * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public * keys used to authenticate with linux based VMs. + * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine.

+ * When this property is not specified in the request body, default behavior is + * to set it to true. This will ensure that VM Agent is installed on the VM so + * that extensions can be added to the VM later. * @member {array} [secrets] The List of certificates for addition to the VM. */ export interface VirtualMachineScaleSetUpdateOSProfile { @@ -2740,8 +2951,9 @@ export interface VirtualMachineScaleSetUpdateOSProfile { * Describes the parameters of a ScaleSet managed disk. * * @member {string} [storageAccountType] Specifies the storage account type for - * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible - * values include: 'Standard_LRS', 'Premium_LRS' + * the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it + * cannot be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface VirtualMachineScaleSetManagedDiskParameters { storageAccountType?: string; @@ -2767,6 +2979,14 @@ export interface VirtualMachineScaleSetManagedDiskParameters { * the imageReference element described above. If you are using a marketplace * image, you also use the plan element previously described. Possible values * include: 'FromImage', 'Empty', 'Attach' + * @member {object} [diffDiskSettings] Specifies the differencing Disk Settings + * for the operating system disk used by the virtual machine scale set. + * @member {string} [diffDiskSettings.option] Specifies the differencing disk + * settings for operating system disk. Possible values include: 'Local' + * @member {number} [diskSizeGB] Specifies the size of the operating system + * disk in gigabytes. This element can be used to overwrite the size of the + * disk in a virtual machine image.

This value cannot be larger than + * 1023 GB * @member {string} [osType] This property allows you to specify the type of * the OS that is included in the disk if creating a VM from user-image or a * specialized VHD.

Possible values are:

**Windows**

@@ -2778,14 +2998,17 @@ export interface VirtualMachineScaleSetManagedDiskParameters { * to store operating system disks for the scale set. * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used with + * data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface VirtualMachineScaleSetOSDisk { name?: string; caching?: string; writeAcceleratorEnabled?: boolean; createOption: string; + diffDiskSettings?: DiffDiskSettings; + diskSizeGB?: number; osType?: string; image?: VirtualHardDisk; vhdContainers?: string[]; @@ -2803,6 +3026,10 @@ export interface VirtualMachineScaleSetOSDisk { * 'None', 'ReadOnly', 'ReadWrite' * @member {boolean} [writeAcceleratorEnabled] Specifies whether * writeAccelerator should be enabled or disabled on the disk. + * @member {number} [diskSizeGB] Specifies the size of the operating system + * disk in gigabytes. This element can be used to overwrite the size of the + * disk in a virtual machine image.

This value cannot be larger than + * 1023 GB * @member {object} [image] The Source User Image VirtualHardDisk. This * VirtualHardDisk will be copied before using it to attach to the Virtual * Machine. If SourceImage is provided, the destination VirtualHardDisk should @@ -2812,12 +3039,14 @@ export interface VirtualMachineScaleSetOSDisk { * uris. * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used with + * data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface VirtualMachineScaleSetUpdateOSDisk { caching?: string; writeAcceleratorEnabled?: boolean; + diskSizeGB?: number; image?: VirtualHardDisk; vhdContainers?: string[]; managedDisk?: VirtualMachineScaleSetManagedDiskParameters; @@ -2842,12 +3071,13 @@ export interface VirtualMachineScaleSetUpdateOSDisk { * @member {string} createOption The create option. Possible values include: * 'FromImage', 'Empty', 'Attach' * @member {number} [diskSizeGB] Specifies the size of an empty data disk in - * gigabytes. This element can be used to overwrite the name of the disk in a + * gigabytes. This element can be used to overwrite the size of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used with + * data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ export interface VirtualMachineScaleSetDataDisk { name?: string; @@ -2900,6 +3130,15 @@ export interface VirtualMachineScaleSetDataDisk { * the imageReference element described above. If you are using a marketplace * image, you also use the plan element previously described. Possible values * include: 'FromImage', 'Empty', 'Attach' + * @member {object} [osDisk.diffDiskSettings] Specifies the differencing Disk + * Settings for the operating system disk used by the virtual machine scale + * set. + * @member {string} [osDisk.diffDiskSettings.option] Specifies the differencing + * disk settings for operating system disk. Possible values include: 'Local' + * @member {number} [osDisk.diskSizeGB] Specifies the size of the operating + * system disk in gigabytes. This element can be used to overwrite the size of + * the disk in a virtual machine image.

This value cannot be larger + * than 1023 GB * @member {string} [osDisk.osType] This property allows you to specify the * type of the OS that is included in the disk if creating a VM from user-image * or a specialized VHD.

Possible values are:

**Windows** @@ -2911,8 +3150,9 @@ export interface VirtualMachineScaleSetDataDisk { * used to store operating system disks for the scale set. * @member {object} [osDisk.managedDisk] The managed disk parameters. * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: Standard_LRS - * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * storage account type for the managed disk. NOTE: UltraSSD_LRS can only be + * used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [dataDisks] Specifies the parameters that are used to add * data disks to the virtual machines in the scale set.

For more * information about disks, see [About disks and VHDs for Azure virtual @@ -2947,6 +3187,10 @@ export interface VirtualMachineScaleSetStorageProfile { * 'None', 'ReadOnly', 'ReadWrite' * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether * writeAccelerator should be enabled or disabled on the disk. + * @member {number} [osDisk.diskSizeGB] Specifies the size of the operating + * system disk in gigabytes. This element can be used to overwrite the size of + * the disk in a virtual machine image.

This value cannot be larger + * than 1023 GB * @member {object} [osDisk.image] The Source User Image VirtualHardDisk. This * VirtualHardDisk will be copied before using it to attach to the Virtual * Machine. If SourceImage is provided, the destination VirtualHardDisk should @@ -2956,8 +3200,9 @@ export interface VirtualMachineScaleSetStorageProfile { * container uris. * @member {object} [osDisk.managedDisk] The managed disk parameters. * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: Standard_LRS - * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * storage account type for the managed disk. NOTE: UltraSSD_LRS can only be + * used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [dataDisks] The data disks. */ export interface VirtualMachineScaleSetUpdateStorageProfile { @@ -2994,6 +3239,21 @@ export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { domainNameLabel: string; } +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetIpTag class. + * @constructor + * Contains the IP tag associated with the public IP address. + * + * @member {string} [ipTagType] IP tag type. Example: FirstPartyUsage. + * @member {string} [tag] IP tag associated with the public IP. Example: SQL, + * Storage etc. + */ +export interface VirtualMachineScaleSetIpTag { + ipTagType?: string; + tag?: string; +} + /** * @class * Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfiguration class. @@ -3009,11 +3269,18 @@ export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { * @member {string} [dnsSettings.domainNameLabel] The Domain name label.The * concatenation of the domain name label and vm index will be the domain name * labels of the PublicIPAddress resources that will be created + * @member {array} [ipTags] The list of IP tags associated with the public IP + * address. + * @member {object} [publicIPPrefix] The PublicIPPrefix from which to allocate + * publicIP addresses. + * @member {string} [publicIPPrefix.id] Resource Id */ export interface VirtualMachineScaleSetPublicIPAddressConfiguration { name: string; idleTimeoutInMinutes?: number; dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + ipTags?: VirtualMachineScaleSetIpTag[]; + publicIPPrefix?: SubResource; } /** @@ -3062,6 +3329,12 @@ export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { * The Domain name label.The concatenation of the domain name label and vm * index will be the domain name labels of the PublicIPAddress resources that * will be created + * @member {array} [publicIPAddressConfiguration.ipTags] The list of IP tags + * associated with the public IP address. + * @member {object} [publicIPAddressConfiguration.publicIPPrefix] The + * PublicIPPrefix from which to allocate publicIP addresses. + * @member {string} [publicIPAddressConfiguration.publicIPPrefix.id] Resource + * Id * @member {string} [privateIPAddressVersion] Available from Api-Version * 2017-03-30 onwards, it represents whether the specific ipconfiguration is * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and @@ -3070,6 +3343,8 @@ export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { * of references to backend address pools of application gateways. A scale set * can reference backend address pools of multiple application gateways. * Multiple scale sets cannot use the same application gateway. + * @member {array} [applicationSecurityGroups] Specifies an array of references + * to application security group. * @member {array} [loadBalancerBackendAddressPools] Specifies an array of * references to backend address pools of load balancers. A scale set can * reference backend address pools of one public and one internal load @@ -3086,6 +3361,7 @@ export interface VirtualMachineScaleSetIPConfiguration extends SubResource { publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration; privateIPAddressVersion?: string; applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; loadBalancerBackendAddressPools?: SubResource[]; loadBalancerInboundNatPools?: SubResource[]; } @@ -3120,6 +3396,8 @@ export interface VirtualMachineScaleSetIPConfiguration extends SubResource { * 'IPv6'. Possible values include: 'IPv4', 'IPv6' * @member {array} [applicationGatewayBackendAddressPools] The application * gateway backend address pools. + * @member {array} [applicationSecurityGroups] Specifies an array of references + * to application security group. * @member {array} [loadBalancerBackendAddressPools] The load balancer backend * address pools. * @member {array} [loadBalancerInboundNatPools] The load balancer inbound nat @@ -3132,6 +3410,7 @@ export interface VirtualMachineScaleSetUpdateIPConfiguration extends SubResource publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; privateIPAddressVersion?: string; applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; loadBalancerBackendAddressPools?: SubResource[]; loadBalancerInboundNatPools?: SubResource[]; } @@ -3387,6 +3666,11 @@ export interface VirtualMachineScaleSetExtensionProfile { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machines in the scale set. * @member {object} [storageProfile] Specifies the storage settings for the @@ -3429,6 +3713,16 @@ export interface VirtualMachineScaleSetExtensionProfile { * you also use the imageReference element described above. If you are using a * marketplace image, you also use the plan element previously described. * Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {object} [storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the virtual + * machine scale set. + * @member {string} [storageProfile.osDisk.diffDiskSettings.option] Specifies + * the differencing disk settings for operating system disk. Possible values + * include: 'Local' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * the operating system disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image.

This + * value cannot be larger than 1023 GB * @member {string} [storageProfile.osDisk.osType] This property allows you to * specify the type of the OS that is included in the disk if creating a VM * from user-image or a specialized VHD.

Possible values are:

@@ -3443,14 +3737,24 @@ export interface VirtualMachineScaleSetExtensionProfile { * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that are * used to add data disks to the virtual machines in the scale set.

* For more information about disks, see [About disks and VHDs for Azure * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [additionalCapabilities] Specifies additional capabilities + * enabled or disabled on the virtual machine in the scale set. For instance: + * whether the virtual machine has the capability to support attaching managed + * data disks with UltraSSD_LRS storage account type. + * @member {boolean} [additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks with + * UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with + * storage account type UltraSSD_LRS can be added to a virtual machine or + * virtual machine scale set only if this property is enabled. * @member {object} [networkProfile] Specifies properties of the network * interfaces of the virtual machines in the scale set. * @member {object} [networkProfile.healthProbe] A reference to a load balancer @@ -3466,9 +3770,8 @@ export interface VirtualMachineScaleSetExtensionProfile { * state.

Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot to - * diagnose VM status.

For Linux Virtual Machines, you can easily view - * the output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * diagnose VM status.

You can easily view the output of your console + * log.

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. @@ -3490,15 +3793,20 @@ export interface VirtualMachineScaleSetExtensionProfile { * @member {string} [priority] Specifies the priority for the virtual machines * in the scale set.

Minimum api-version: 2017-10-30-preview. Possible * values include: 'Regular', 'Low' + * @member {string} [evictionPolicy] Specifies the eviction policy for virtual + * machines in a low priority scale set.

Minimum api-version: + * 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' */ export interface VirtualMachineScaleSetVMProfile { osProfile?: VirtualMachineScaleSetOSProfile; storageProfile?: VirtualMachineScaleSetStorageProfile; + additionalCapabilities?: AdditionalCapabilities; networkProfile?: VirtualMachineScaleSetNetworkProfile; diagnosticsProfile?: DiagnosticsProfile; extensionProfile?: VirtualMachineScaleSetExtensionProfile; licenseType?: string; priority?: string; + evictionPolicy?: string; } /** @@ -3537,6 +3845,11 @@ export interface VirtualMachineScaleSetVMProfile { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * @member {array} [osProfile.secrets] The List of certificates for addition to * the VM. * @member {object} [storageProfile] The virtual machine scale set storage @@ -3560,6 +3873,10 @@ export interface VirtualMachineScaleSetVMProfile { * values include: 'None', 'ReadOnly', 'ReadWrite' * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies * whether writeAccelerator should be enabled or disabled on the disk. + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * the operating system disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image.

This + * value cannot be larger than 1023 GB * @member {object} [storageProfile.osDisk.image] The Source User Image * VirtualHardDisk. This VirtualHardDisk will be copied before using it to * attach to the Virtual Machine. If SourceImage is provided, the destination @@ -3571,9 +3888,10 @@ export interface VirtualMachineScaleSetVMProfile { * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] The data disks. * @member {object} [networkProfile] The virtual machine scale set network * profile. @@ -3583,9 +3901,8 @@ export interface VirtualMachineScaleSetVMProfile { * diagnostics profile. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot to - * diagnose VM status.

For Linux Virtual Machines, you can easily view - * the output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * diagnose VM status.

You can easily view the output of your console + * log.

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. @@ -3668,9 +3985,16 @@ export interface VirtualMachineScaleSetUpdateVMProfile { * between completing the update for all virtual machines in one batch and * starting the next batch. The time duration should be specified in ISO 8601 * format. The default value is 0 seconds (PT0S). - * @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades - * should automatically be applied to scale set instances in a rolling fashion - * when a newer version of the image becomes available. + * @member {object} [upgradePolicy.automaticOSUpgradePolicy] Configuration + * parameters used for performing automatic OS Upgrade. + * @member {boolean} + * [upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. Default value + * is false. + * @member {boolean} + * [upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] Whether OS + * image rollback feature should be disabled. Default value is false. * @member {object} [virtualMachineProfile] The virtual machine profile. * @member {object} [virtualMachineProfile.osProfile] Specifies the operating * system settings for the virtual machines in the scale set. @@ -3753,6 +4077,12 @@ export interface VirtualMachineScaleSetUpdateVMProfile { * @member {array} * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The list * of SSH public keys used to authenticate with linux based VMs. + * @member {boolean} + * [virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. * @member {array} [virtualMachineProfile.osProfile.secrets] Specifies set of * certificates that should be installed onto the virtual machines in the scale * set. @@ -3804,6 +4134,18 @@ export interface VirtualMachineScaleSetUpdateVMProfile { * described above. If you are using a marketplace image, you also use the * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' + * @member {object} + * [virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the virtual + * machine scale set. + * @member {string} + * [virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * @member {number} [virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

This value cannot be larger than 1023 GB * @member {string} [virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the * disk if creating a VM from user-image or a specialized VHD.

@@ -3821,14 +4163,25 @@ export interface VirtualMachineScaleSetUpdateVMProfile { * The managed disk parameters. * @member {string} * [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [virtualMachineProfile.storageProfile.dataDisks] Specifies * the parameters that are used to add data disks to the virtual machines in * the scale set.

For more information about disks, see [About disks * and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [virtualMachineProfile.additionalCapabilities] Specifies + * additional capabilities enabled or disabled on the virtual machine in the + * scale set. For instance: whether the virtual machine has the capability to + * support attaching managed data disks with UltraSSD_LRS storage account type. + * @member {boolean} + * [virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks with + * UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with + * storage account type UltraSSD_LRS can be added to a virtual machine or + * virtual machine scale set only if this property is enabled. * @member {object} [virtualMachineProfile.networkProfile] Specifies properties * of the network interfaces of the virtual machines in the scale set. * @member {object} [virtualMachineProfile.networkProfile.healthProbe] A @@ -3846,9 +4199,8 @@ export interface VirtualMachineScaleSetUpdateVMProfile { * boot diagnostic settings state.

Minimum api-version: 2015-06-15. * @member {object} [virtualMachineProfile.diagnosticsProfile.bootDiagnostics] * Boot Diagnostics is a debugging feature which allows you to view Console - * Output and Screenshot to diagnose VM status.

For Linux Virtual - * Machines, you can easily view the output of your console log.

For - * both Windows and Linux virtual machines, Azure also enables you to see a + * Output and Screenshot to diagnose VM status.

You can easily view + * the output of your console log.

Azure also enables you to see a * screenshot of the VM from the hypervisor. * @member {boolean} * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] Whether @@ -3874,6 +4226,10 @@ export interface VirtualMachineScaleSetUpdateVMProfile { * @member {string} [virtualMachineProfile.priority] Specifies the priority for * the virtual machines in the scale set.

Minimum api-version: * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * @member {string} [virtualMachineProfile.evictionPolicy] Specifies the + * eviction policy for virtual machines in a low priority scale set. + *

Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' * @member {string} [provisioningState] The provisioning state, which only * appears in the response. * @member {boolean} [overprovision] Specifies whether the Virtual Machine @@ -3900,10 +4256,10 @@ export interface VirtualMachineScaleSetUpdateVMProfile { * 'None' will remove any identities from the virtual machine scale set. * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, * UserAssigned', 'None' - * @member {array} [identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the virtual machine scale set. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * @member {array} [zones] The virtual machine scale set zones. */ export interface VirtualMachineScaleSet extends Resource { @@ -3977,9 +4333,16 @@ export interface VirtualMachineScaleSet extends Resource { * between completing the update for all virtual machines in one batch and * starting the next batch. The time duration should be specified in ISO 8601 * format. The default value is 0 seconds (PT0S). - * @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades - * should automatically be applied to scale set instances in a rolling fashion - * when a newer version of the image becomes available. + * @member {object} [upgradePolicy.automaticOSUpgradePolicy] Configuration + * parameters used for performing automatic OS Upgrade. + * @member {boolean} + * [upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. Default value + * is false. + * @member {boolean} + * [upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] Whether OS + * image rollback feature should be disabled. Default value is false. * @member {object} [virtualMachineProfile] The virtual machine profile. * @member {object} [virtualMachineProfile.osProfile] The virtual machine scale * set OS profile. @@ -4019,6 +4382,12 @@ export interface VirtualMachineScaleSet extends Resource { * @member {array} * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The list * of SSH public keys used to authenticate with linux based VMs. + * @member {boolean} + * [virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. * @member {array} [virtualMachineProfile.osProfile.secrets] The List of * certificates for addition to the VM. * @member {object} [virtualMachineProfile.storageProfile] The virtual machine @@ -4048,6 +4417,10 @@ export interface VirtualMachineScaleSet extends Resource { * [virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] * Specifies whether writeAccelerator should be enabled or disabled on the * disk. + * @member {number} [virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

This value cannot be larger than 1023 GB * @member {object} [virtualMachineProfile.storageProfile.osDisk.image] The * Source User Image VirtualHardDisk. This VirtualHardDisk will be copied * before using it to attach to the Virtual Machine. If SourceImage is @@ -4060,9 +4433,10 @@ export interface VirtualMachineScaleSet extends Resource { * The managed disk parameters. * @member {string} * [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [virtualMachineProfile.storageProfile.dataDisks] The data * disks. * @member {object} [virtualMachineProfile.networkProfile] The virtual machine @@ -4074,9 +4448,8 @@ export interface VirtualMachineScaleSet extends Resource { * machine scale set diagnostics profile. * @member {object} [virtualMachineProfile.diagnosticsProfile.bootDiagnostics] * Boot Diagnostics is a debugging feature which allows you to view Console - * Output and Screenshot to diagnose VM status.

For Linux Virtual - * Machines, you can easily view the output of your console log.

For - * both Windows and Linux virtual machines, Azure also enables you to see a + * Output and Screenshot to diagnose VM status.

You can easily view + * the output of your console log.

Azure also enables you to see a * screenshot of the VM from the hypervisor. * @member {boolean} * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] Whether @@ -4108,10 +4481,10 @@ export interface VirtualMachineScaleSet extends Resource { * 'None' will remove any identities from the virtual machine scale set. * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, * UserAssigned', 'None' - * @member {array} [identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the virtual machine scale set. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ export interface VirtualMachineScaleSetUpdate extends UpdateResource { sku?: Sku; @@ -4260,139 +4633,540 @@ export interface VirtualMachineScaleSetSku { /** * @class - * Initializes a new instance of the VirtualMachineScaleSetVM class. + * Initializes a new instance of the ApiErrorBase class. * @constructor - * Describes a virtual machine scale set virtual machine. + * Api error base. * - * @member {string} [instanceId] The virtual machine instance ID. - * @member {object} [sku] The virtual machine SKU. - * @member {string} [sku.name] The sku name. - * @member {string} [sku.tier] Specifies the tier of virtual machines in a - * scale set.

Possible Values:

**Standard**

- * **Basic** - * @member {number} [sku.capacity] Specifies the number of virtual machines in - * the scale set. - * @member {boolean} [latestModelApplied] Specifies whether the latest model - * has been applied to the virtual machine. - * @member {string} [vmId] Azure VM unique ID. - * @member {object} [instanceView] The virtual machine instance view. - * @member {number} [instanceView.platformUpdateDomain] Specifies the update - * domain of the virtual machine. - * @member {number} [instanceView.platformFaultDomain] Specifies the fault - * domain of the virtual machine. - * @member {string} [instanceView.computerName] The computer name assigned to - * the virtual machine. - * @member {string} [instanceView.osName] The Operating System running on the - * virtual machine. - * @member {string} [instanceView.osVersion] The version of Operating System - * running on the virtual machine. - * @member {string} [instanceView.rdpThumbPrint] The Remote desktop certificate - * thumbprint. - * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual - * machine. - * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full - * version. - * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual machine - * extension handler instance view. - * @member {array} [instanceView.vmAgent.statuses] The resource status - * information. - * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance - * Operation status on the virtual machine. - * @member {boolean} - * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] - * True, if customer is allowed to perform Maintenance. - * @member {date} - * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] Start - * Time for the Pre Maintenance Window. - * @member {date} - * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End - * Time for the Pre Maintenance Window. - * @member {date} - * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start - * Time for the Maintenance Window. - * @member {date} - * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time - * for the Maintenance Window. - * @member {string} - * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last - * Maintenance Operation Result Code. Possible values include: 'None', - * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' - * @member {string} - * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message - * returned for the last Maintenance Operation. - * @member {array} [instanceView.disks] The virtual machine disk information. - * @member {array} [instanceView.extensions] The extensions information. - * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a - * debugging feature which allows you to view Console Output and Screenshot to - * diagnose VM status.

For Linux Virtual Machines, you can easily view - * the output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the - * hypervisor. - * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] The - * console screenshot blob URI. - * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The - * Linux serial console log blob Uri. - * @member {array} [instanceView.statuses] The resource status information. - * @member {object} [hardwareProfile] Specifies the hardware settings for the - * virtual machine. - * @member {string} [hardwareProfile.vmSize] Specifies the size of the virtual - * machine. For more information about virtual machine sizes, see [Sizes for - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

The available VM sizes depend on region and availability set. For a - * list of available sizes use these APIs:

[List all available - * virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) - *

[List all available virtual machine sizes in a - * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) - *

[List all available virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', - * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', - * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', - * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', - * 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', - * 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', - * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', - * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', - * 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', - * 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', - * 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', - * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', - * 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', - * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', - * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', - * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', - * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', - * 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - * 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', - * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', - * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', - * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', - * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', - * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', - * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', - * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', - * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', - * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', - * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', - * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', - * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', - * 'Standard_NV12', 'Standard_NV24' - * @member {object} [storageProfile] Specifies the storage settings for the - * virtual machine disks. + * @member {string} [code] The error code. + * @member {string} [target] The target of the particular error. + * @member {string} [message] The error message. + */ +export interface ApiErrorBase { + code?: string; + target?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the InnerError class. + * @constructor + * Inner error details. + * + * @member {string} [exceptiontype] The exception type. + * @member {string} [errordetail] The internal error message or exception dump. + */ +export interface InnerError { + exceptiontype?: string; + errordetail?: string; +} + +/** + * @class + * Initializes a new instance of the ApiError class. + * @constructor + * Api error. + * + * @member {array} [details] The Api error details + * @member {object} [innererror] The Api inner error + * @member {string} [innererror.exceptiontype] The exception type. + * @member {string} [innererror.errordetail] The internal error message or + * exception dump. + * @member {string} [code] The error code. + * @member {string} [target] The target of the particular error. + * @member {string} [message] The error message. + */ +export interface ApiError { + details?: ApiErrorBase[]; + innererror?: InnerError; + code?: string; + target?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the RollbackStatusInfo class. + * @constructor + * Information about rollback on failed VM instances after a OS Upgrade + * operation. + * + * @member {number} [successfullyRolledbackInstanceCount] The number of + * instances which have been successfully rolled back. + * @member {number} [failedRolledbackInstanceCount] The number of instances + * which failed to rollback. + * @member {object} [rollbackError] Error details if OS rollback failed. + * @member {array} [rollbackError.details] The Api error details + * @member {object} [rollbackError.innererror] The Api inner error + * @member {string} [rollbackError.innererror.exceptiontype] The exception + * type. + * @member {string} [rollbackError.innererror.errordetail] The internal error + * message or exception dump. + * @member {string} [rollbackError.code] The error code. + * @member {string} [rollbackError.target] The target of the particular error. + * @member {string} [rollbackError.message] The error message. + */ +export interface RollbackStatusInfo { + readonly successfullyRolledbackInstanceCount?: number; + readonly failedRolledbackInstanceCount?: number; + readonly rollbackError?: ApiError; +} + +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoryStatus class. + * @constructor + * Information about the current running state of the overall upgrade. + * + * @member {string} [code] Code indicating the current status of the upgrade. + * Possible values include: 'RollingForward', 'Cancelled', 'Completed', + * 'Faulted' + * @member {date} [startTime] Start time of the upgrade. + * @member {date} [endTime] End time of the upgrade. + */ +export interface UpgradeOperationHistoryStatus { + readonly code?: string; + readonly startTime?: Date; + readonly endTime?: Date; +} + +/** + * @class + * Initializes a new instance of the RollingUpgradeProgressInfo class. + * @constructor + * Information about the number of virtual machine instances in each upgrade + * state. + * + * @member {number} [successfulInstanceCount] The number of instances that have + * been successfully upgraded. + * @member {number} [failedInstanceCount] The number of instances that have + * failed to be upgraded successfully. + * @member {number} [inProgressInstanceCount] The number of instances that are + * currently being upgraded. + * @member {number} [pendingInstanceCount] The number of instances that have + * not yet begun to be upgraded. + */ +export interface RollingUpgradeProgressInfo { + readonly successfulInstanceCount?: number; + readonly failedInstanceCount?: number; + readonly inProgressInstanceCount?: number; + readonly pendingInstanceCount?: number; +} + +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoricalStatusInfoProperties class. + * @constructor + * Describes each OS upgrade on the Virtual Machine Scale Set. + * + * @member {object} [runningStatus] Information about the overall status of the + * upgrade operation. + * @member {string} [runningStatus.code] Code indicating the current status of + * the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {date} [runningStatus.endTime] End time of the upgrade. + * @member {object} [progress] Counts of the VM's in each state. + * @member {number} [progress.successfulInstanceCount] The number of instances + * that have been successfully upgraded. + * @member {number} [progress.failedInstanceCount] The number of instances that + * have failed to be upgraded successfully. + * @member {number} [progress.inProgressInstanceCount] The number of instances + * that are currently being upgraded. + * @member {number} [progress.pendingInstanceCount] The number of instances + * that have not yet begun to be upgraded. + * @member {object} [error] Error Details for this upgrade if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + * @member {string} [startedBy] Invoker of the Upgrade Operation. Possible + * values include: 'Unknown', 'User', 'Platform' + * @member {object} [targetImageReference] Image Reference details + * @member {string} [targetImageReference.publisher] The image publisher. + * @member {string} [targetImageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [targetImageReference.sku] The image SKU. + * @member {string} [targetImageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. The + * allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build + * are decimal numbers. Specify 'latest' to use the latest version of an image + * available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes + * available. + * @member {object} [rollbackInfo] Information about OS rollback if performed + * @member {number} [rollbackInfo.successfullyRolledbackInstanceCount] The + * number of instances which have been successfully rolled back. + * @member {number} [rollbackInfo.failedRolledbackInstanceCount] The number of + * instances which failed to rollback. + * @member {object} [rollbackInfo.rollbackError] Error details if OS rollback + * failed. + * @member {array} [rollbackInfo.rollbackError.details] The Api error details + * @member {object} [rollbackInfo.rollbackError.innererror] The Api inner error + * @member {string} [rollbackInfo.rollbackError.innererror.exceptiontype] The + * exception type. + * @member {string} [rollbackInfo.rollbackError.innererror.errordetail] The + * internal error message or exception dump. + * @member {string} [rollbackInfo.rollbackError.code] The error code. + * @member {string} [rollbackInfo.rollbackError.target] The target of the + * particular error. + * @member {string} [rollbackInfo.rollbackError.message] The error message. + */ +export interface UpgradeOperationHistoricalStatusInfoProperties { + readonly runningStatus?: UpgradeOperationHistoryStatus; + readonly progress?: RollingUpgradeProgressInfo; + readonly error?: ApiError; + readonly startedBy?: string; + readonly targetImageReference?: ImageReference; + readonly rollbackInfo?: RollbackStatusInfo; +} + +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoricalStatusInfo class. + * @constructor + * Virtual Machine Scale Set OS Upgrade History operation response. + * + * @member {object} [properties] Information about the properties of the + * upgrade operation. + * @member {object} [properties.runningStatus] Information about the overall + * status of the upgrade operation. + * @member {string} [properties.runningStatus.code] Code indicating the current + * status of the upgrade. Possible values include: 'RollingForward', + * 'Cancelled', 'Completed', 'Faulted' + * @member {date} [properties.runningStatus.startTime] Start time of the + * upgrade. + * @member {date} [properties.runningStatus.endTime] End time of the upgrade. + * @member {object} [properties.progress] Counts of the VM's in each state. + * @member {number} [properties.progress.successfulInstanceCount] The number of + * instances that have been successfully upgraded. + * @member {number} [properties.progress.failedInstanceCount] The number of + * instances that have failed to be upgraded successfully. + * @member {number} [properties.progress.inProgressInstanceCount] The number of + * instances that are currently being upgraded. + * @member {number} [properties.progress.pendingInstanceCount] The number of + * instances that have not yet begun to be upgraded. + * @member {object} [properties.error] Error Details for this upgrade if there + * are any. + * @member {array} [properties.error.details] The Api error details + * @member {object} [properties.error.innererror] The Api inner error + * @member {string} [properties.error.innererror.exceptiontype] The exception + * type. + * @member {string} [properties.error.innererror.errordetail] The internal + * error message or exception dump. + * @member {string} [properties.error.code] The error code. + * @member {string} [properties.error.target] The target of the particular + * error. + * @member {string} [properties.error.message] The error message. + * @member {string} [properties.startedBy] Invoker of the Upgrade Operation. + * Possible values include: 'Unknown', 'User', 'Platform' + * @member {object} [properties.targetImageReference] Image Reference details + * @member {string} [properties.targetImageReference.publisher] The image + * publisher. + * @member {string} [properties.targetImageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [properties.targetImageReference.sku] The image SKU. + * @member {string} [properties.targetImageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {object} [properties.rollbackInfo] Information about OS rollback if + * performed + * @member {number} + * [properties.rollbackInfo.successfullyRolledbackInstanceCount] The number of + * instances which have been successfully rolled back. + * @member {number} [properties.rollbackInfo.failedRolledbackInstanceCount] The + * number of instances which failed to rollback. + * @member {object} [properties.rollbackInfo.rollbackError] Error details if OS + * rollback failed. + * @member {array} [properties.rollbackInfo.rollbackError.details] The Api + * error details + * @member {object} [properties.rollbackInfo.rollbackError.innererror] The Api + * inner error + * @member {string} + * [properties.rollbackInfo.rollbackError.innererror.exceptiontype] The + * exception type. + * @member {string} + * [properties.rollbackInfo.rollbackError.innererror.errordetail] The internal + * error message or exception dump. + * @member {string} [properties.rollbackInfo.rollbackError.code] The error + * code. + * @member {string} [properties.rollbackInfo.rollbackError.target] The target + * of the particular error. + * @member {string} [properties.rollbackInfo.rollbackError.message] The error + * message. + * @member {string} [type] Resource type + * @member {string} [location] Resource location + */ +export interface UpgradeOperationHistoricalStatusInfo { + readonly properties?: UpgradeOperationHistoricalStatusInfoProperties; + readonly type?: string; + readonly location?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineHealthStatus class. + * @constructor + * The health status of the VM. + * + * @member {object} [status] The health status information for the VM. + * @member {string} [status.code] The status code. + * @member {string} [status.level] The level code. Possible values include: + * 'Info', 'Warning', 'Error' + * @member {string} [status.displayStatus] The short localizable label for the + * status. + * @member {string} [status.message] The detailed status message, including for + * alerts and error messages. + * @member {date} [status.time] The time of the status. + */ +export interface VirtualMachineHealthStatus { + readonly status?: InstanceViewStatus; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVMInstanceView class. + * @constructor + * The instance view of a virtual machine scale set VM. + * + * @member {number} [platformUpdateDomain] The Update Domain count. + * @member {number} [platformFaultDomain] The Fault Domain count. + * @member {string} [rdpThumbPrint] The Remote desktop certificate thumbprint. + * @member {object} [vmAgent] The VM Agent running on the virtual machine. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension + * handler instance view. + * @member {array} [vmAgent.statuses] The resource status information. + * @member {object} [maintenanceRedeployStatus] The Maintenance Operation + * status on the virtual machine. + * @member {boolean} + * [maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] True, if + * customer is allowed to perform Maintenance. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowStartTime] + * Start Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} [maintenanceRedeployStatus.lastOperationResultCode] The + * Last Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} [maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [disks] The disks information. + * @member {array} [extensions] The extensions information. + * @member {object} [vmHealth] The health status for the VM. + * @member {object} [vmHealth.status] The health status information for the VM. + * @member {string} [vmHealth.status.code] The status code. + * @member {string} [vmHealth.status.level] The level code. Possible values + * include: 'Info', 'Warning', 'Error' + * @member {string} [vmHealth.status.displayStatus] The short localizable label + * for the status. + * @member {string} [vmHealth.status.message] The detailed status message, + * including for alerts and error messages. + * @member {date} [vmHealth.status.time] The time of the status. + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows you to view Console Output and Screenshot to diagnose VM + * status.

You can easily view the output of your console log. + *

Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. + * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial + * console log blob Uri. + * @member {object} [bootDiagnostics.status] The boot diagnostics status + * information for the VM.

NOTE: It will be set only if there are + * errors encountered in enabling boot diagnostics. + * @member {string} [bootDiagnostics.status.code] The status code. + * @member {string} [bootDiagnostics.status.level] The level code. Possible + * values include: 'Info', 'Warning', 'Error' + * @member {string} [bootDiagnostics.status.displayStatus] The short + * localizable label for the status. + * @member {string} [bootDiagnostics.status.message] The detailed status + * message, including for alerts and error messages. + * @member {date} [bootDiagnostics.status.time] The time of the status. + * @member {array} [statuses] The resource status information. + * @member {string} [placementGroupId] The placement group in which the VM is + * running. If the VM is deallocated it will not have a placementGroupId. + */ +export interface VirtualMachineScaleSetVMInstanceView { + platformUpdateDomain?: number; + platformFaultDomain?: number; + rdpThumbPrint?: string; + vmAgent?: VirtualMachineAgentInstanceView; + maintenanceRedeployStatus?: MaintenanceRedeployStatus; + disks?: DiskInstanceView[]; + extensions?: VirtualMachineExtensionInstanceView[]; + readonly vmHealth?: VirtualMachineHealthStatus; + bootDiagnostics?: BootDiagnosticsInstanceView; + statuses?: InstanceViewStatus[]; + placementGroupId?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVM class. + * @constructor + * Describes a virtual machine scale set virtual machine. + * + * @member {string} [instanceId] The virtual machine instance ID. + * @member {object} [sku] The virtual machine SKU. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

Possible Values:

**Standard**

+ * **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines in + * the scale set. + * @member {boolean} [latestModelApplied] Specifies whether the latest model + * has been applied to the virtual machine. + * @member {string} [vmId] Azure VM unique ID. + * @member {object} [instanceView] The virtual machine instance view. + * @member {number} [instanceView.platformUpdateDomain] The Update Domain + * count. + * @member {number} [instanceView.platformFaultDomain] The Fault Domain count. + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop certificate + * thumbprint. + * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual + * machine. + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full + * version. + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual machine + * extension handler instance view. + * @member {array} [instanceView.vmAgent.statuses] The resource status + * information. + * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance + * Operation status on the virtual machine. + * @member {boolean} + * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] + * True, if customer is allowed to perform Maintenance. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] Start + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last + * Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [instanceView.disks] The disks information. + * @member {array} [instanceView.extensions] The extensions information. + * @member {object} [instanceView.vmHealth] The health status for the VM. + * @member {object} [instanceView.vmHealth.status] The health status + * information for the VM. + * @member {string} [instanceView.vmHealth.status.code] The status code. + * @member {string} [instanceView.vmHealth.status.level] The level code. + * Possible values include: 'Info', 'Warning', 'Error' + * @member {string} [instanceView.vmHealth.status.displayStatus] The short + * localizable label for the status. + * @member {string} [instanceView.vmHealth.status.message] The detailed status + * message, including for alerts and error messages. + * @member {date} [instanceView.vmHealth.status.time] The time of the status. + * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

You can easily view the output of your console + * log.

Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] The + * console screenshot blob URI. + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The + * Linux serial console log blob Uri. + * @member {object} [instanceView.bootDiagnostics.status] The boot diagnostics + * status information for the VM.

NOTE: It will be set only if there + * are errors encountered in enabling boot diagnostics. + * @member {string} [instanceView.bootDiagnostics.status.code] The status code. + * @member {string} [instanceView.bootDiagnostics.status.level] The level code. + * Possible values include: 'Info', 'Warning', 'Error' + * @member {string} [instanceView.bootDiagnostics.status.displayStatus] The + * short localizable label for the status. + * @member {string} [instanceView.bootDiagnostics.status.message] The detailed + * status message, including for alerts and error messages. + * @member {date} [instanceView.bootDiagnostics.status.time] The time of the + * status. + * @member {array} [instanceView.statuses] The resource status information. + * @member {string} [instanceView.placementGroupId] The placement group in + * which the VM is running. If the VM is deallocated it will not have a + * placementGroupId. + * @member {object} [hardwareProfile] Specifies the hardware settings for the + * virtual machine. + * @member {string} [hardwareProfile.vmSize] Specifies the size of the virtual + * machine. For more information about virtual machine sizes, see [Sizes for + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

[List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

[List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

[List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', + * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', + * 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', + * 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', + * 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', + * 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', + * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', + * 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', + * 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. * @member {object} [storageProfile.imageReference] Specifies information about * the image to use. You can specify information about platform images, * marketplace images, or virtual machine images. This element is required when @@ -4464,6 +5238,12 @@ export interface VirtualMachineScaleSetSku { * 'ReadOnly', 'ReadWrite' * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies * whether writeAccelerator should be enabled or disabled on the disk. + * @member {object} [storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the virtual + * machine. + * @member {string} [storageProfile.osDisk.diffDiskSettings.option] Specifies + * the differencing disk settings for operating system disk. Possible values + * include: 'Local' * @member {string} [storageProfile.osDisk.createOption] Specifies how the * virtual machine should be created.

Possible values are:

* **Attach** \u2013 This value is used when you are using a specialized disk @@ -4474,19 +5254,29 @@ export interface VirtualMachineScaleSetSku { * previously described. Possible values include: 'FromImage', 'Empty', * 'Attach' * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an - * empty data disk in gigabytes. This element can be used to overwrite the name + * empty data disk in gigabytes. This element can be used to overwrite the size * of the disk in a virtual machine image.

This value cannot be larger * than 1023 GB * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that are * used to add a data disk to a virtual machine.

For more information * about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [additionalCapabilities] Specifies additional capabilities + * enabled or disabled on the virtual machine in the scale set. For instance: + * whether the virtual machine has the capability to support attaching managed + * data disks with UltraSSD_LRS storage account type. + * @member {boolean} [additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks with + * UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with + * storage account type UltraSSD_LRS can be added to a virtual machine or + * virtual machine scale set only if this property is enabled. * @member {object} [osProfile] Specifies the operating system settings for the * virtual machine. * @member {string} [osProfile.computerName] Specifies the host OS name of the @@ -4562,8 +5352,17 @@ export interface VirtualMachineScaleSetSku { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machine. + * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether + * extension operations should be allowed on the virtual machine.

This + * may only be set to False when no extensions are present on the virtual + * machine. * @member {object} [networkProfile] Specifies the network interfaces of the * virtual machine. * @member {array} [networkProfile.networkInterfaces] Specifies the list of @@ -4572,9 +5371,8 @@ export interface VirtualMachineScaleSetSku { * state.

Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot to - * diagnose VM status.

For Linux Virtual Machines, you can easily view - * the output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * diagnose VM status.

You can easily view the output of your console + * log.

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. @@ -4617,15 +5415,17 @@ export interface VirtualMachineScaleSetSku { * element. * @member {string} [plan.promotionCode] The promotion code. * @member {array} [resources] The virtual machine child extension resources. + * @member {array} [zones] The virtual machine zones. */ export interface VirtualMachineScaleSetVM extends Resource { readonly instanceId?: string; readonly sku?: Sku; readonly latestModelApplied?: boolean; readonly vmId?: string; - readonly instanceView?: VirtualMachineInstanceView; + readonly instanceView?: VirtualMachineScaleSetVMInstanceView; hardwareProfile?: HardwareProfile; storageProfile?: StorageProfile; + additionalCapabilities?: AdditionalCapabilities; osProfile?: OSProfile; networkProfile?: NetworkProfile; diagnosticsProfile?: DiagnosticsProfile; @@ -4634,97 +5434,7 @@ export interface VirtualMachineScaleSetVM extends Resource { licenseType?: string; plan?: Plan; readonly resources?: VirtualMachineExtension[]; -} - -/** - * @class - * Initializes a new instance of the VirtualMachineHealthStatus class. - * @constructor - * The health status of the VM. - * - * @member {object} [status] The health status information for the VM. - * @member {string} [status.code] The status code. - * @member {string} [status.level] The level code. Possible values include: - * 'Info', 'Warning', 'Error' - * @member {string} [status.displayStatus] The short localizable label for the - * status. - * @member {string} [status.message] The detailed status message, including for - * alerts and error messages. - * @member {date} [status.time] The time of the status. - */ -export interface VirtualMachineHealthStatus { - readonly status?: InstanceViewStatus; -} - -/** - * @class - * Initializes a new instance of the VirtualMachineScaleSetVMInstanceView class. - * @constructor - * The instance view of a virtual machine scale set VM. - * - * @member {number} [platformUpdateDomain] The Update Domain count. - * @member {number} [platformFaultDomain] The Fault Domain count. - * @member {string} [rdpThumbPrint] The Remote desktop certificate thumbprint. - * @member {object} [vmAgent] The VM Agent running on the virtual machine. - * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. - * @member {array} [vmAgent.extensionHandlers] The virtual machine extension - * handler instance view. - * @member {array} [vmAgent.statuses] The resource status information. - * @member {object} [maintenanceRedeployStatus] The Maintenance Operation - * status on the virtual machine. - * @member {boolean} - * [maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] True, if - * customer is allowed to perform Maintenance. - * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowStartTime] - * Start Time for the Pre Maintenance Window. - * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowEndTime] End - * Time for the Pre Maintenance Window. - * @member {date} [maintenanceRedeployStatus.maintenanceWindowStartTime] Start - * Time for the Maintenance Window. - * @member {date} [maintenanceRedeployStatus.maintenanceWindowEndTime] End Time - * for the Maintenance Window. - * @member {string} [maintenanceRedeployStatus.lastOperationResultCode] The - * Last Maintenance Operation Result Code. Possible values include: 'None', - * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' - * @member {string} [maintenanceRedeployStatus.lastOperationMessage] Message - * returned for the last Maintenance Operation. - * @member {array} [disks] The disks information. - * @member {array} [extensions] The extensions information. - * @member {object} [vmHealth] The health status for the VM. - * @member {object} [vmHealth.status] The health status information for the VM. - * @member {string} [vmHealth.status.code] The status code. - * @member {string} [vmHealth.status.level] The level code. Possible values - * include: 'Info', 'Warning', 'Error' - * @member {string} [vmHealth.status.displayStatus] The short localizable label - * for the status. - * @member {string} [vmHealth.status.message] The detailed status message, - * including for alerts and error messages. - * @member {date} [vmHealth.status.time] The time of the status. - * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature - * which allows you to view Console Output and Screenshot to diagnose VM - * status.

For Linux Virtual Machines, you can easily view the output - * of your console log.

For both Windows and Linux virtual machines, - * Azure also enables you to see a screenshot of the VM from the hypervisor. - * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console - * screenshot blob URI. - * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial - * console log blob Uri. - * @member {array} [statuses] The resource status information. - * @member {string} [placementGroupId] The placement group in which the VM is - * running. If the VM is deallocated it will not have a placementGroupId. - */ -export interface VirtualMachineScaleSetVMInstanceView { - platformUpdateDomain?: number; - platformFaultDomain?: number; - rdpThumbPrint?: string; - vmAgent?: VirtualMachineAgentInstanceView; - maintenanceRedeployStatus?: MaintenanceRedeployStatus; - disks?: DiskInstanceView[]; - extensions?: VirtualMachineExtensionInstanceView[]; - readonly vmHealth?: VirtualMachineHealthStatus; - bootDiagnostics?: BootDiagnosticsInstanceView; - statuses?: InstanceViewStatus[]; - placementGroupId?: string; + readonly zones?: string[]; } /** @@ -4748,82 +5458,6 @@ export interface RollingUpgradeRunningStatus { readonly lastActionTime?: Date; } -/** - * @class - * Initializes a new instance of the RollingUpgradeProgressInfo class. - * @constructor - * Information about the number of virtual machine instances in each upgrade - * state. - * - * @member {number} [successfulInstanceCount] The number of instances that have - * been successfully upgraded. - * @member {number} [failedInstanceCount] The number of instances that have - * failed to be upgraded successfully. - * @member {number} [inProgressInstanceCount] The number of instances that are - * currently being upgraded. - * @member {number} [pendingInstanceCount] The number of instances that have - * not yet begun to be upgraded. - */ -export interface RollingUpgradeProgressInfo { - readonly successfulInstanceCount?: number; - readonly failedInstanceCount?: number; - readonly inProgressInstanceCount?: number; - readonly pendingInstanceCount?: number; -} - -/** - * @class - * Initializes a new instance of the ApiErrorBase class. - * @constructor - * Api error base. - * - * @member {string} [code] The error code. - * @member {string} [target] The target of the particular error. - * @member {string} [message] The error message. - */ -export interface ApiErrorBase { - code?: string; - target?: string; - message?: string; -} - -/** - * @class - * Initializes a new instance of the InnerError class. - * @constructor - * Inner error details. - * - * @member {string} [exceptiontype] The exception type. - * @member {string} [errordetail] The internal error message or exception dump. - */ -export interface InnerError { - exceptiontype?: string; - errordetail?: string; -} - -/** - * @class - * Initializes a new instance of the ApiError class. - * @constructor - * Api error. - * - * @member {array} [details] The Api error details - * @member {object} [innererror] The Api inner error - * @member {string} [innererror.exceptiontype] The exception type. - * @member {string} [innererror.errordetail] The internal error message or - * exception dump. - * @member {string} [code] The error code. - * @member {string} [target] The target of the particular error. - * @member {string} [message] The error message. - */ -export interface ApiError { - details?: ApiErrorBase[]; - innererror?: InnerError; - code?: string; - target?: string; - message?: string; -} - /** * @class * Initializes a new instance of the RollingUpgradeStatusInfo class. @@ -4890,60 +5524,20 @@ export interface RollingUpgradeStatusInfo extends Resource { readonly error?: ApiError; } -/** - * @class - * Initializes a new instance of the ComputeLongRunningOperationProperties class. - * @constructor - * Compute-specific operation properties, including output - * - * @member {object} [output] Operation output data (raw JSON) - */ -export interface ComputeLongRunningOperationProperties { - output?: any; -} - /** * @class * Initializes a new instance of the RecoveryWalkResponse class. * @constructor - * Response after calling a manual recovery walk - * - * @member {boolean} [walkPerformed] Whether the recovery walk was performed - * @member {number} [nextPlatformUpdateDomain] The next update domain that - * needs to be walked. Null means walk spanning all update domains has been - * completed - */ -export interface RecoveryWalkResponse { - readonly walkPerformed?: boolean; - readonly nextPlatformUpdateDomain?: number; -} - -/** - * @class - * Initializes a new instance of the OperationStatusResponse class. - * @constructor - * Operation status response - * - * @member {string} [name] Operation ID - * @member {string} [status] Operation status - * @member {date} [startTime] Start time of the operation - * @member {date} [endTime] End time of the operation - * @member {object} [error] Api error - * @member {array} [error.details] The Api error details - * @member {object} [error.innererror] The Api inner error - * @member {string} [error.innererror.exceptiontype] The exception type. - * @member {string} [error.innererror.errordetail] The internal error message - * or exception dump. - * @member {string} [error.code] The error code. - * @member {string} [error.target] The target of the particular error. - * @member {string} [error.message] The error message. + * Response after calling a manual recovery walk + * + * @member {boolean} [walkPerformed] Whether the recovery walk was performed + * @member {number} [nextPlatformUpdateDomain] The next update domain that + * needs to be walked. Null means walk spanning all update domains has been + * completed */ -export interface OperationStatusResponse { - readonly name?: string; - readonly status?: string; - readonly startTime?: Date; - readonly endTime?: Date; - readonly error?: ApiError; +export interface RecoveryWalkResponse { + readonly walkPerformed?: boolean; + readonly nextPlatformUpdateDomain?: number; } /** @@ -5016,7 +5610,7 @@ export interface LogAnalyticsOutput { * @member {object} [properties] LogAnalyticsOutput * @member {string} [properties.output] Output file Uri path to blob container. */ -export interface LogAnalyticsOperationResult extends OperationStatusResponse { +export interface LogAnalyticsOperationResult { readonly properties?: LogAnalyticsOutput; } @@ -5110,12 +5704,10 @@ export interface RunCommandDocument extends RunCommandDocumentBase { * @class * Initializes a new instance of the RunCommandResult class. * @constructor - * Run command operation response. - * - * @member {object} [output] Operation output data (raw JSON) + * @member {array} [value] Run command operation response. */ -export interface RunCommandResult extends OperationStatusResponse { - output?: any; +export interface RunCommandResult { + value?: InstanceViewStatus[]; } /** @@ -5273,10 +5865,11 @@ export interface ResourceSku { * @class * Initializes a new instance of the DiskSku class. * @constructor - * The disks sku name. Can be Standard_LRS or Premium_LRS. + * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or + * UltraSSD_LRS. * * @member {string} [name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {string} [tier] The sku tier. Default value: 'Standard' . */ export interface DiskSku { @@ -5284,30 +5877,13 @@ export interface DiskSku { readonly tier?: string; } -/** - * @class - * Initializes a new instance of the ResourceUpdate class. - * @constructor - * The Resource model definition. - * - * @member {object} [tags] Resource tags - * @member {object} [sku] - * @member {string} [sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' - * @member {string} [sku.tier] The sku tier. - */ -export interface ResourceUpdate { - tags?: { [propertyName: string]: string }; - sku?: DiskSku; -} - /** * @class * Initializes a new instance of the ImageDiskReference class. * @constructor * The source image used for creating the disk. * - * @member {string} id A relative uri containing either a Platform Imgage + * @member {string} id A relative uri containing either a Platform Image * Repository or user image reference. * @member {number} [lun] If the disk is created from an image's data disk, * this is an index that indicates which of the data disks in the image to use. @@ -5332,7 +5908,7 @@ export interface ImageDiskReference { * import as a disk. Required only if the blob is in a different subscription * @member {object} [imageReference] Disk source information. * @member {string} [imageReference.id] A relative uri containing either a - * Platform Imgage Repository or user image reference. + * Platform Image Repository or user image reference. * @member {number} [imageReference.lun] If the disk is created from an image's * data disk, this is an index that indicates which of the data disks in the * image to use. For OS disks, this field is null. @@ -5437,7 +6013,7 @@ export interface EncryptionSettings { * has the disk attached. * @member {object} [sku] * @member {string} [sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {string} [sku.tier] The sku tier. * @member {array} [zones] The Logical zone list for Disk. * @member {date} [timeCreated] The time when the disk was created. @@ -5454,7 +6030,7 @@ export interface EncryptionSettings { * subscription * @member {object} [creationData.imageReference] Disk source information. * @member {string} [creationData.imageReference.id] A relative uri containing - * either a Platform Imgage Repository or user image reference. + * either a Platform Image Repository or user image reference. * @member {number} [creationData.imageReference.lun] If the disk is created * from an image's data disk, this is an index that indicates which of the data * disks in the image to use. For OS disks, this field is null. @@ -5491,6 +6067,12 @@ export interface EncryptionSettings { * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing * to a key or secret in KeyVault * @member {string} [provisioningState] The disk provisioning state. + * @member {number} [diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * @member {number} [diskMBpsReadWrite] The bandwidth allowed for this disk; + * only settable for UltraSSD disks. MBps means millions of bytes per second - + * MB here uses the ISO notation, of powers of 10. */ export interface Disk extends Resource { readonly managedBy?: string; @@ -5502,6 +6084,8 @@ export interface Disk extends Resource { diskSizeGB?: number; encryptionSettings?: EncryptionSettings; readonly provisioningState?: string; + diskIOPSReadWrite?: number; + diskMBpsReadWrite?: number; } /** @@ -5540,11 +6124,26 @@ export interface Disk extends Resource { * Resource Id * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing * to a key or secret in KeyVault + * @member {number} [diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * @member {number} [diskMBpsReadWrite] The bandwidth allowed for this disk; + * only settable for UltraSSD disks. MBps means millions of bytes per second - + * MB here uses the ISO notation, of powers of 10. + * @member {object} [tags] Resource tags + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' + * @member {string} [sku.tier] The sku tier. */ -export interface DiskUpdate extends ResourceUpdate { +export interface DiskUpdate { osType?: string; diskSizeGB?: number; encryptionSettings?: EncryptionSettings; + diskIOPSReadWrite?: number; + diskMBpsReadWrite?: number; + tags?: { [propertyName: string]: string }; + sku?: DiskSku; } /** @@ -5614,7 +6213,7 @@ export interface AccessUri { * subscription * @member {object} [creationData.imageReference] Disk source information. * @member {string} [creationData.imageReference.id] A relative uri containing - * either a Platform Imgage Repository or user image reference. + * either a Platform Image Repository or user image reference. * @member {number} [creationData.imageReference.lun] If the disk is created * from an image's data disk, this is an index that indicates which of the data * disks in the image to use. For OS disks, this field is null. @@ -5699,11 +6298,412 @@ export interface Snapshot extends Resource { * Resource Id * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing * to a key or secret in KeyVault + * @member {object} [tags] Resource tags + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * @member {string} [sku.tier] The sku tier. */ -export interface SnapshotUpdate extends ResourceUpdate { +export interface SnapshotUpdate { osType?: string; diskSizeGB?: number; encryptionSettings?: EncryptionSettings; + tags?: { [propertyName: string]: string }; + sku?: SnapshotSku; +} + +/** + * @class + * Initializes a new instance of the GalleryIdentifier class. + * @constructor + * Describes the gallery unique name. + * + * @member {string} [uniqueName] The unique name of the Shared Image Gallery. + * This name is generated automatically by Azure. + */ +export interface GalleryIdentifier { + readonly uniqueName?: string; +} + +/** + * @class + * Initializes a new instance of the Gallery class. + * @constructor + * Specifies information about the Shared Image Gallery that you want to create + * or update. + * + * @member {string} [description] The description of this Shared Image Gallery + * resource. This property is updateable. + * @member {object} [identifier] + * @member {string} [identifier.uniqueName] The unique name of the Shared Image + * Gallery. This name is generated automatically by Azure. + * @member {string} [provisioningState] The current state of the gallery. The + * provisioning state, which only appears in the response. Possible values + * include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', + * 'Migrating' + */ +export interface Gallery extends Resource { + description?: string; + identifier?: GalleryIdentifier; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the GalleryImageIdentifier class. + * @constructor + * This is the gallery Image Definition identifier. + * + * @member {string} publisher The name of the gallery Image Definition + * publisher. + * @member {string} offer The name of the gallery Image Definition offer. + * @member {string} sku The name of the gallery Image Definition SKU. + */ +export interface GalleryImageIdentifier { + publisher: string; + offer: string; + sku: string; +} + +/** + * @class + * Initializes a new instance of the ResourceRange class. + * @constructor + * Describes the resource range. + * + * @member {number} [min] The minimum number of the resource. + * @member {number} [max] The maximum number of the resource. + */ +export interface ResourceRange { + min?: number; + max?: number; +} + +/** + * @class + * Initializes a new instance of the RecommendedMachineConfiguration class. + * @constructor + * The properties describe the recommended machine configuration for this Image + * Definition. These properties are updateable. + * + * @member {object} [vCPUs] + * @member {number} [vCPUs.min] The minimum number of the resource. + * @member {number} [vCPUs.max] The maximum number of the resource. + * @member {object} [memory] + * @member {number} [memory.min] The minimum number of the resource. + * @member {number} [memory.max] The maximum number of the resource. + */ +export interface RecommendedMachineConfiguration { + vCPUs?: ResourceRange; + memory?: ResourceRange; +} + +/** + * @class + * Initializes a new instance of the Disallowed class. + * @constructor + * Describes the disallowed disk types. + * + * @member {array} [diskTypes] A list of disk types. + */ +export interface Disallowed { + diskTypes?: string[]; +} + +/** + * @class + * Initializes a new instance of the ImagePurchasePlan class. + * @constructor + * Describes the gallery Image Definition purchase plan. This is used by + * marketplace images. + * + * @member {string} [name] The plan ID. + * @member {string} [publisher] The publisher ID. + * @member {string} [product] The product ID. + */ +export interface ImagePurchasePlan { + name?: string; + publisher?: string; + product?: string; +} + +/** + * @class + * Initializes a new instance of the GalleryImage class. + * @constructor + * Specifies information about the gallery Image Definition that you want to + * create or update. + * + * @member {string} [description] The description of this gallery Image + * Definition resource. This property is updateable. + * @member {string} [eula] The Eula agreement for the gallery Image Definition. + * @member {string} [privacyStatementUri] The privacy statement uri. + * @member {string} [releaseNoteUri] The release note uri. + * @member {string} osType This property allows you to specify the type of the + * OS that is included in the disk when creating a VM from a managed image. + *

Possible values are:

**Windows**

**Linux**. + * Possible values include: 'Windows', 'Linux' + * @member {string} osState The allowed values for OS State are 'Generalized'. + * Possible values include: 'Generalized', 'Specialized' + * @member {date} [endOfLifeDate] The end of life date of the gallery Image + * Definition. This property can be used for decommissioning purposes. This + * property is updateable. + * @member {object} identifier + * @member {string} [identifier.publisher] The name of the gallery Image + * Definition publisher. + * @member {string} [identifier.offer] The name of the gallery Image Definition + * offer. + * @member {string} [identifier.sku] The name of the gallery Image Definition + * SKU. + * @member {object} [recommended] + * @member {object} [recommended.vCPUs] + * @member {number} [recommended.vCPUs.min] The minimum number of the resource. + * @member {number} [recommended.vCPUs.max] The maximum number of the resource. + * @member {object} [recommended.memory] + * @member {number} [recommended.memory.min] The minimum number of the + * resource. + * @member {number} [recommended.memory.max] The maximum number of the + * resource. + * @member {object} [disallowed] + * @member {array} [disallowed.diskTypes] A list of disk types. + * @member {object} [purchasePlan] + * @member {string} [purchasePlan.name] The plan ID. + * @member {string} [purchasePlan.publisher] The publisher ID. + * @member {string} [purchasePlan.product] The product ID. + * @member {string} [provisioningState] The current state of the gallery Image + * Definition. The provisioning state, which only appears in the response. + * Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + * 'Deleting', 'Migrating' + */ +export interface GalleryImage extends Resource { + description?: string; + eula?: string; + privacyStatementUri?: string; + releaseNoteUri?: string; + osType: string; + osState: string; + endOfLifeDate?: Date; + identifier: GalleryImageIdentifier; + recommended?: RecommendedMachineConfiguration; + disallowed?: Disallowed; + purchasePlan?: ImagePurchasePlan; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the GalleryArtifactPublishingProfileBase class. + * @constructor + * Describes the basic gallery artifact publishing profile. + * + * @member {array} [targetRegions] The target regions where the Image Version + * is going to be replicated to. This property is updateable. + * @member {object} source + * @member {object} [source.managedImage] + * @member {string} [source.managedImage.id] The managed artifact id. + */ +export interface GalleryArtifactPublishingProfileBase { + targetRegions?: TargetRegion[]; + source: GalleryArtifactSource; +} + +/** + * @class + * Initializes a new instance of the GalleryImageVersionPublishingProfile class. + * @constructor + * The publishing profile of a gallery Image Version. + * + * @member {number} [replicaCount] The number of replicas of the Image Version + * to be created per region. This property would take effect for a region when + * regionalReplicaCount is not specified. This property is updateable. + * @member {boolean} [excludeFromLatest] If set to true, Virtual Machines + * deployed from the latest version of the Image Definition won't use this + * Image Version. + * @member {date} [publishedDate] The timestamp for when the gallery Image + * Version is published. + * @member {date} [endOfLifeDate] The end of life date of the gallery Image + * Version. This property can be used for decommissioning purposes. This + * property is updateable. + */ +export interface GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + replicaCount?: number; + excludeFromLatest?: boolean; + readonly publishedDate?: Date; + endOfLifeDate?: Date; +} + +/** + * @class + * Initializes a new instance of the GalleryDiskImage class. + * @constructor + * This is the disk image base class. + * + * @member {number} [sizeInGB] This property indicates the size of the VHD to + * be created. + * @member {string} [hostCaching] The host caching of the disk. Valid values + * are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + */ +export interface GalleryDiskImage { + readonly sizeInGB?: number; + readonly hostCaching?: string; +} + +/** + * @class + * Initializes a new instance of the GalleryOSDiskImage class. + * @constructor + * This is the OS disk image. + * + */ +export interface GalleryOSDiskImage extends GalleryDiskImage { +} + +/** + * @class + * Initializes a new instance of the GalleryDataDiskImage class. + * @constructor + * This is the data disk image. + * + * @member {number} [lun] This property specifies the logical unit number of + * the data disk. This value is used to identify data disks within the Virtual + * Machine and therefore must be unique for each data disk attached to the + * Virtual Machine. + */ +export interface GalleryDataDiskImage extends GalleryDiskImage { + readonly lun?: number; +} + +/** + * @class + * Initializes a new instance of the GalleryImageVersionStorageProfile class. + * @constructor + * This is the storage profile of a gallery Image Version. + * + * @member {object} [osDiskImage] + * @member {array} [dataDiskImages] A list of data disk images. + */ +export interface GalleryImageVersionStorageProfile { + readonly osDiskImage?: GalleryOSDiskImage; + readonly dataDiskImages?: GalleryDataDiskImage[]; +} + +/** + * @class + * Initializes a new instance of the RegionalReplicationStatus class. + * @constructor + * This is the regional replication status. + * + * @member {string} [region] The region to which the gallery Image Version is + * being replicated to. + * @member {string} [state] This is the regional replication state. Possible + * values include: 'Unknown', 'Replicating', 'Completed', 'Failed' + * @member {string} [details] The details of the replication status. + * @member {number} [progress] It indicates progress of the replication job. + */ +export interface RegionalReplicationStatus { + readonly region?: string; + readonly state?: string; + readonly details?: string; + readonly progress?: number; +} + +/** + * @class + * Initializes a new instance of the ReplicationStatus class. + * @constructor + * This is the replication status of the gallery Image Version. + * + * @member {string} [aggregatedState] This is the aggregated replication status + * based on all the regional replication status flags. Possible values include: + * 'Unknown', 'InProgress', 'Completed', 'Failed' + * @member {array} [summary] This is a summary of replication status for each + * region. + */ +export interface ReplicationStatus { + readonly aggregatedState?: string; + readonly summary?: RegionalReplicationStatus[]; +} + +/** + * @class + * Initializes a new instance of the GalleryImageVersion class. + * @constructor + * Specifies information about the gallery Image Version that you want to + * create or update. + * + * @member {object} publishingProfile + * @member {number} [publishingProfile.replicaCount] The number of replicas of + * the Image Version to be created per region. This property would take effect + * for a region when regionalReplicaCount is not specified. This property is + * updateable. + * @member {boolean} [publishingProfile.excludeFromLatest] If set to true, + * Virtual Machines deployed from the latest version of the Image Definition + * won't use this Image Version. + * @member {date} [publishingProfile.publishedDate] The timestamp for when the + * gallery Image Version is published. + * @member {date} [publishingProfile.endOfLifeDate] The end of life date of the + * gallery Image Version. This property can be used for decommissioning + * purposes. This property is updateable. + * @member {string} [provisioningState] The current state of the gallery Image + * Version. The provisioning state, which only appears in the response. + * Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + * 'Deleting', 'Migrating' + * @member {object} [storageProfile] + * @member {object} [storageProfile.osDiskImage] + * @member {array} [storageProfile.dataDiskImages] A list of data disk images. + * @member {object} [replicationStatus] + * @member {string} [replicationStatus.aggregatedState] This is the aggregated + * replication status based on all the regional replication status flags. + * Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' + * @member {array} [replicationStatus.summary] This is a summary of replication + * status for each region. + */ +export interface GalleryImageVersion extends Resource { + publishingProfile: GalleryImageVersionPublishingProfile; + readonly provisioningState?: string; + readonly storageProfile?: GalleryImageVersionStorageProfile; + readonly replicationStatus?: ReplicationStatus; +} + +/** + * @class + * Initializes a new instance of the TargetRegion class. + * @constructor + * Describes the target region information. + * + * @member {string} name The name of the region. + * @member {number} [regionalReplicaCount] The number of replicas of the Image + * Version to be created per region. This property is updateable. + */ +export interface TargetRegion { + name: string; + regionalReplicaCount?: number; +} + +/** + * @class + * Initializes a new instance of the ManagedArtifact class. + * @constructor + * The managed artifact. + * + * @member {string} id The managed artifact id. + */ +export interface ManagedArtifact { + id: string; +} + +/** + * @class + * Initializes a new instance of the GalleryArtifactSource class. + * @constructor + * The source image from which the Image Version is going to be created. + * + * @member {object} managedImage + * @member {string} [managedImage.id] The managed artifact id. + */ +export interface GalleryArtifactSource { + managedImage: ManagedArtifact; } /** @@ -5971,8 +6971,12 @@ export interface ComputeOperationListResult extends Array * @constructor * The List Availability Set operation response. * + * @member {string} [nextLink] The URI to fetch the next page of + * AvailabilitySets. Call ListNext() with this URI to fetch the next page of + * AvailabilitySets. */ export interface AvailabilitySetListResult extends Array { + nextLink?: string; } /** @@ -5987,28 +6991,28 @@ export interface VirtualMachineSizeListResult extends Array /** * @class - * Initializes a new instance of the VirtualMachineListResult class. + * Initializes a new instance of the ListUsagesResult class. * @constructor - * The List Virtual Machine operation response. + * The List Usages operation response. * - * @member {string} [nextLink] The URI to fetch the next page of VMs. Call - * ListNext() with this URI to fetch the next page of Virtual Machines. + * @member {string} [nextLink] The URI to fetch the next page of compute + * resource usage information. Call ListNext() with this to fetch the next page + * of compute resource usage information. */ -export interface VirtualMachineListResult extends Array { +export interface ListUsagesResult extends Array { nextLink?: string; } /** * @class - * Initializes a new instance of the ListUsagesResult class. + * Initializes a new instance of the VirtualMachineListResult class. * @constructor - * The List Usages operation response. + * The List Virtual Machine operation response. * - * @member {string} [nextLink] The URI to fetch the next page of compute - * resource usage information. Call ListNext() with this to fetch the next page - * of compute resource usage information. + * @member {string} [nextLink] The URI to fetch the next page of VMs. Call + * ListNext() with this URI to fetch the next page of Virtual Machines. */ -export interface ListUsagesResult extends Array { +export interface VirtualMachineListResult extends Array { nextLink?: string; } @@ -6067,6 +7071,20 @@ export interface VirtualMachineScaleSetListSkusResult extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the VirtualMachineScaleSetExtensionListResult class. @@ -6147,6 +7165,47 @@ export interface SnapshotList extends Array { nextLink?: string; } +/** + * @class + * Initializes a new instance of the GalleryList class. + * @constructor + * The List Galleries operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of galleries. + * Call ListNext() with this to fetch the next page of galleries. + */ +export interface GalleryList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the GalleryImageList class. + * @constructor + * The List Gallery Images operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of Image + * Definitions in the Shared Image Gallery. Call ListNext() with this to fetch + * the next page of gallery Image Definitions. + */ +export interface GalleryImageList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the GalleryImageVersionList class. + * @constructor + * The List Gallery Image version operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of gallery Image + * Versions. Call ListNext() with this to fetch the next page of gallery Image + * Versions. + */ +export interface GalleryImageVersionList extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the ContainerServiceListResult class. diff --git a/lib/services/computeManagement2/lib/models/index.js b/lib/services/computeManagement2/lib/models/index.js index f396363aaa..fcbbc7572e 100644 --- a/lib/services/computeManagement2/lib/models/index.js +++ b/lib/services/computeManagement2/lib/models/index.js @@ -48,10 +48,12 @@ exports.KeyVaultSecretReference = require('./keyVaultSecretReference'); exports.KeyVaultKeyReference = require('./keyVaultKeyReference'); exports.DiskEncryptionSettings = require('./diskEncryptionSettings'); exports.VirtualHardDisk = require('./virtualHardDisk'); +exports.DiffDiskSettings = require('./diffDiskSettings'); exports.ManagedDiskParameters = require('./managedDiskParameters'); exports.OSDisk = require('./oSDisk'); exports.DataDisk = require('./dataDisk'); exports.StorageProfile = require('./storageProfile'); +exports.AdditionalCapabilities = require('./additionalCapabilities'); exports.AdditionalUnattendContent = require('./additionalUnattendContent'); exports.WinRMListener = require('./winRMListener'); exports.WinRMConfiguration = require('./winRMConfiguration'); @@ -70,11 +72,13 @@ exports.VirtualMachineExtensionHandlerInstanceView = require('./virtualMachineEx exports.VirtualMachineAgentInstanceView = require('./virtualMachineAgentInstanceView'); exports.DiskInstanceView = require('./diskInstanceView'); exports.BootDiagnosticsInstanceView = require('./bootDiagnosticsInstanceView'); +exports.VirtualMachineIdentityUserAssignedIdentitiesValue = require('./virtualMachineIdentityUserAssignedIdentitiesValue'); exports.VirtualMachineIdentity = require('./virtualMachineIdentity'); exports.MaintenanceRedeployStatus = require('./maintenanceRedeployStatus'); exports.VirtualMachineInstanceView = require('./virtualMachineInstanceView'); exports.VirtualMachine = require('./virtualMachine'); exports.VirtualMachineUpdate = require('./virtualMachineUpdate'); +exports.AutomaticOSUpgradePolicy = require('./automaticOSUpgradePolicy'); exports.RollingUpgradePolicy = require('./rollingUpgradePolicy'); exports.UpgradePolicy = require('./upgradePolicy'); exports.ImageOSDisk = require('./imageOSDisk'); @@ -82,6 +86,7 @@ exports.ImageDataDisk = require('./imageDataDisk'); exports.ImageStorageProfile = require('./imageStorageProfile'); exports.Image = require('./image'); exports.ImageUpdate = require('./imageUpdate'); +exports.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue = require('./virtualMachineScaleSetIdentityUserAssignedIdentitiesValue'); exports.VirtualMachineScaleSetIdentity = require('./virtualMachineScaleSetIdentity'); exports.VirtualMachineScaleSetOSProfile = require('./virtualMachineScaleSetOSProfile'); exports.VirtualMachineScaleSetUpdateOSProfile = require('./virtualMachineScaleSetUpdateOSProfile'); @@ -93,6 +98,7 @@ exports.VirtualMachineScaleSetStorageProfile = require('./virtualMachineScaleSet exports.VirtualMachineScaleSetUpdateStorageProfile = require('./virtualMachineScaleSetUpdateStorageProfile'); exports.ApiEntityReference = require('./apiEntityReference'); exports.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings = require('./virtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'); +exports.VirtualMachineScaleSetIpTag = require('./virtualMachineScaleSetIpTag'); exports.VirtualMachineScaleSetPublicIPAddressConfiguration = require('./virtualMachineScaleSetPublicIPAddressConfiguration'); exports.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration = require('./virtualMachineScaleSetUpdatePublicIPAddressConfiguration'); exports.VirtualMachineScaleSetIPConfiguration = require('./virtualMachineScaleSetIPConfiguration'); @@ -117,18 +123,20 @@ exports.VirtualMachineScaleSetVMExtensionsSummary = require('./virtualMachineSca exports.VirtualMachineScaleSetInstanceView = require('./virtualMachineScaleSetInstanceView'); exports.VirtualMachineScaleSetSkuCapacity = require('./virtualMachineScaleSetSkuCapacity'); exports.VirtualMachineScaleSetSku = require('./virtualMachineScaleSetSku'); -exports.VirtualMachineScaleSetVM = require('./virtualMachineScaleSetVM'); -exports.VirtualMachineHealthStatus = require('./virtualMachineHealthStatus'); -exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView'); -exports.RollingUpgradeRunningStatus = require('./rollingUpgradeRunningStatus'); -exports.RollingUpgradeProgressInfo = require('./rollingUpgradeProgressInfo'); exports.ApiErrorBase = require('./apiErrorBase'); exports.InnerError = require('./innerError'); exports.ApiError = require('./apiError'); +exports.RollbackStatusInfo = require('./rollbackStatusInfo'); +exports.UpgradeOperationHistoryStatus = require('./upgradeOperationHistoryStatus'); +exports.RollingUpgradeProgressInfo = require('./rollingUpgradeProgressInfo'); +exports.UpgradeOperationHistoricalStatusInfoProperties = require('./upgradeOperationHistoricalStatusInfoProperties'); +exports.UpgradeOperationHistoricalStatusInfo = require('./upgradeOperationHistoricalStatusInfo'); +exports.VirtualMachineHealthStatus = require('./virtualMachineHealthStatus'); +exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView'); +exports.VirtualMachineScaleSetVM = require('./virtualMachineScaleSetVM'); +exports.RollingUpgradeRunningStatus = require('./rollingUpgradeRunningStatus'); exports.RollingUpgradeStatusInfo = require('./rollingUpgradeStatusInfo'); -exports.ComputeLongRunningOperationProperties = require('./computeLongRunningOperationProperties'); exports.RecoveryWalkResponse = require('./recoveryWalkResponse'); -exports.OperationStatusResponse = require('./operationStatusResponse'); exports.LogAnalyticsInputBase = require('./logAnalyticsInputBase'); exports.RequestRateByIntervalInput = require('./requestRateByIntervalInput'); exports.ThrottledRequestsInput = require('./throttledRequestsInput'); @@ -148,7 +156,6 @@ exports.ResourceSkuRestrictions = require('./resourceSkuRestrictions'); exports.ResourceSkuLocationInfo = require('./resourceSkuLocationInfo'); exports.ResourceSku = require('./resourceSku'); exports.DiskSku = require('./diskSku'); -exports.ResourceUpdate = require('./resourceUpdate'); exports.ImageDiskReference = require('./imageDiskReference'); exports.CreationData = require('./creationData'); exports.SourceVault = require('./sourceVault'); @@ -162,6 +169,26 @@ exports.GrantAccessData = require('./grantAccessData'); exports.AccessUri = require('./accessUri'); exports.Snapshot = require('./snapshot'); exports.SnapshotUpdate = require('./snapshotUpdate'); +exports.GalleryIdentifier = require('./galleryIdentifier'); +exports.Gallery = require('./gallery'); +exports.GalleryImageIdentifier = require('./galleryImageIdentifier'); +exports.ResourceRange = require('./resourceRange'); +exports.RecommendedMachineConfiguration = require('./recommendedMachineConfiguration'); +exports.Disallowed = require('./disallowed'); +exports.ImagePurchasePlan = require('./imagePurchasePlan'); +exports.GalleryImage = require('./galleryImage'); +exports.GalleryArtifactPublishingProfileBase = require('./galleryArtifactPublishingProfileBase'); +exports.GalleryImageVersionPublishingProfile = require('./galleryImageVersionPublishingProfile'); +exports.GalleryDiskImage = require('./galleryDiskImage'); +exports.GalleryOSDiskImage = require('./galleryOSDiskImage'); +exports.GalleryDataDiskImage = require('./galleryDataDiskImage'); +exports.GalleryImageVersionStorageProfile = require('./galleryImageVersionStorageProfile'); +exports.RegionalReplicationStatus = require('./regionalReplicationStatus'); +exports.ReplicationStatus = require('./replicationStatus'); +exports.GalleryImageVersion = require('./galleryImageVersion'); +exports.TargetRegion = require('./targetRegion'); +exports.ManagedArtifact = require('./managedArtifact'); +exports.GalleryArtifactSource = require('./galleryArtifactSource'); exports.ContainerServiceCustomProfile = require('./containerServiceCustomProfile'); exports.ContainerServiceServicePrincipalProfile = require('./containerServiceServicePrincipalProfile'); exports.ContainerServiceOrchestratorProfile = require('./containerServiceOrchestratorProfile'); @@ -177,16 +204,20 @@ exports.ContainerService = require('./containerService'); exports.ComputeOperationListResult = require('./computeOperationListResult'); exports.AvailabilitySetListResult = require('./availabilitySetListResult'); exports.VirtualMachineSizeListResult = require('./virtualMachineSizeListResult'); -exports.VirtualMachineListResult = require('./virtualMachineListResult'); exports.ListUsagesResult = require('./listUsagesResult'); +exports.VirtualMachineListResult = require('./virtualMachineListResult'); exports.ImageListResult = require('./imageListResult'); exports.VirtualMachineScaleSetListResult = require('./virtualMachineScaleSetListResult'); exports.VirtualMachineScaleSetListWithLinkResult = require('./virtualMachineScaleSetListWithLinkResult'); exports.VirtualMachineScaleSetListSkusResult = require('./virtualMachineScaleSetListSkusResult'); +exports.VirtualMachineScaleSetListOSUpgradeHistory = require('./virtualMachineScaleSetListOSUpgradeHistory'); exports.VirtualMachineScaleSetExtensionListResult = require('./virtualMachineScaleSetExtensionListResult'); exports.VirtualMachineScaleSetVMListResult = require('./virtualMachineScaleSetVMListResult'); exports.RunCommandListResult = require('./runCommandListResult'); exports.ResourceSkusResult = require('./resourceSkusResult'); exports.DiskList = require('./diskList'); exports.SnapshotList = require('./snapshotList'); +exports.GalleryList = require('./galleryList'); +exports.GalleryImageList = require('./galleryImageList'); +exports.GalleryImageVersionList = require('./galleryImageVersionList'); exports.ContainerServiceListResult = require('./containerServiceListResult'); diff --git a/lib/services/computeManagement2/lib/models/keyVaultAndKeyReference.js b/lib/services/computeManagement2/lib/models/keyVaultAndKeyReference.js index a20c7e9b39..6c9bf7d60b 100644 --- a/lib/services/computeManagement2/lib/models/keyVaultAndKeyReference.js +++ b/lib/services/computeManagement2/lib/models/keyVaultAndKeyReference.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Key Vault Key Url and vault id of KeK, KeK is optional and when provided is * used to unwrap the encryptionKey diff --git a/lib/services/computeManagement2/lib/models/keyVaultAndSecretReference.js b/lib/services/computeManagement2/lib/models/keyVaultAndSecretReference.js index 967bc9c38c..aa6bcbfe5a 100644 --- a/lib/services/computeManagement2/lib/models/keyVaultAndSecretReference.js +++ b/lib/services/computeManagement2/lib/models/keyVaultAndSecretReference.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Key Vault Secret Url and vault id of the encryption key * diff --git a/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js b/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js index d5875b2927..f66d9f0e9d 100644 --- a/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js +++ b/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a reference to Key Vault Key * diff --git a/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js b/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js index ea317e47e8..422a764da3 100644 --- a/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js +++ b/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a reference to Key Vault Secret * diff --git a/lib/services/computeManagement2/lib/models/linuxConfiguration.js b/lib/services/computeManagement2/lib/models/linuxConfiguration.js index 879d4b2cc5..e5b3822cc4 100644 --- a/lib/services/computeManagement2/lib/models/linuxConfiguration.js +++ b/lib/services/computeManagement2/lib/models/linuxConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Specifies the Linux operating system settings on the virtual machine. *

For a list of supported Linux distributions, see [Linux on @@ -30,6 +28,11 @@ class LinuxConfiguration { * @member {object} [ssh] Specifies the ssh key configuration for a Linux OS. * @member {array} [ssh.publicKeys] The list of SSH public keys used to * authenticate with linux based VMs. + * @member {boolean} [provisionVMAgent] Indicates whether virtual machine + * agent should be provisioned on the virtual machine.

When this + * property is not specified in the request body, default behavior is to set + * it to true. This will ensure that VM Agent is installed on the VM so that + * extensions can be added to the VM later. */ constructor() { } @@ -62,6 +65,13 @@ class LinuxConfiguration { name: 'Composite', className: 'SshConfiguration' } + }, + provisionVMAgent: { + required: false, + serializedName: 'provisionVMAgent', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js b/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js index 0bc73509e1..993e0aa9af 100644 --- a/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js +++ b/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js @@ -10,14 +10,11 @@ 'use strict'; -const models = require('./index'); - /** * LogAnalytics operation status response * - * @extends models['OperationStatusResponse'] */ -class LogAnalyticsOperationResult extends models['OperationStatusResponse'] { +class LogAnalyticsOperationResult { /** * Create a LogAnalyticsOperationResult. * @member {object} [properties] LogAnalyticsOutput @@ -25,7 +22,6 @@ class LogAnalyticsOperationResult extends models['OperationStatusResponse'] { * container. */ constructor() { - super(); } /** @@ -42,47 +38,6 @@ class LogAnalyticsOperationResult extends models['OperationStatusResponse'] { name: 'Composite', className: 'LogAnalyticsOperationResult', modelProperties: { - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - status: { - required: false, - readOnly: true, - serializedName: 'status', - type: { - name: 'String' - } - }, - startTime: { - required: false, - readOnly: true, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - readOnly: true, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - error: { - required: false, - readOnly: true, - serializedName: 'error', - type: { - name: 'Composite', - className: 'ApiError' - } - }, properties: { required: false, readOnly: true, diff --git a/lib/services/computeManagement2/lib/models/managedArtifact.js b/lib/services/computeManagement2/lib/models/managedArtifact.js new file mode 100644 index 0000000000..a9b4659fd4 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/managedArtifact.js @@ -0,0 +1,52 @@ +/* + * 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 managed artifact. + * + */ +class ManagedArtifact { + /** + * Create a ManagedArtifact. + * @member {string} id The managed artifact id. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedArtifact + * + * @returns {object} metadata of ManagedArtifact + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedArtifact', + type: { + name: 'Composite', + className: 'ManagedArtifact', + modelProperties: { + id: { + required: true, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedArtifact; diff --git a/lib/services/computeManagement2/lib/models/managedDiskParameters.js b/lib/services/computeManagement2/lib/models/managedDiskParameters.js index 3764fa7812..9505796d9c 100644 --- a/lib/services/computeManagement2/lib/models/managedDiskParameters.js +++ b/lib/services/computeManagement2/lib/models/managedDiskParameters.js @@ -21,8 +21,9 @@ class ManagedDiskParameters extends models['SubResource'] { /** * Create a ManagedDiskParameters. * @member {string} [storageAccountType] Specifies the storage account type - * for the managed disk. Possible values are: Standard_LRS or Premium_LRS. - * Possible values include: 'Standard_LRS', 'Premium_LRS' + * for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, + * it cannot be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ constructor() { super(); diff --git a/lib/services/computeManagement2/lib/models/networkProfile.js b/lib/services/computeManagement2/lib/models/networkProfile.js index 050b2faa00..7d6912dada 100644 --- a/lib/services/computeManagement2/lib/models/networkProfile.js +++ b/lib/services/computeManagement2/lib/models/networkProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Specifies the network interfaces of the virtual machine. * diff --git a/lib/services/computeManagement2/lib/models/oSDisk.js b/lib/services/computeManagement2/lib/models/oSDisk.js index bf576f1740..18e3a4c0dd 100644 --- a/lib/services/computeManagement2/lib/models/oSDisk.js +++ b/lib/services/computeManagement2/lib/models/oSDisk.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Specifies information about the operating system disk used by the virtual * machine.

For more information about disks, see [About disks and @@ -61,6 +59,10 @@ class OSDisk { * 'ReadWrite' * @member {boolean} [writeAcceleratorEnabled] Specifies whether * writeAccelerator should be enabled or disabled on the disk. + * @member {object} [diffDiskSettings] Specifies the differencing Disk + * Settings for the operating system disk used by the virtual machine. + * @member {string} [diffDiskSettings.option] Specifies the differencing disk + * settings for operating system disk. Possible values include: 'Local' * @member {string} createOption Specifies how the virtual machine should be * created.

Possible values are:

**Attach** \u2013 This value * is used when you are using a specialized disk to create the virtual @@ -70,12 +72,13 @@ class OSDisk { * using a marketplace image, you also use the plan element previously * described. Possible values include: 'FromImage', 'Empty', 'Attach' * @member {number} [diskSizeGB] Specifies the size of an empty data disk in - * gigabytes. This element can be used to overwrite the name of the disk in a + * gigabytes. This element can be used to overwrite the size of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used + * with data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ constructor() { } @@ -148,6 +151,14 @@ class OSDisk { name: 'Boolean' } }, + diffDiskSettings: { + required: false, + serializedName: 'diffDiskSettings', + type: { + name: 'Composite', + className: 'DiffDiskSettings' + } + }, createOption: { required: true, serializedName: 'createOption', diff --git a/lib/services/computeManagement2/lib/models/oSProfile.js b/lib/services/computeManagement2/lib/models/oSProfile.js index cf904eba6f..60b86fa154 100644 --- a/lib/services/computeManagement2/lib/models/oSProfile.js +++ b/lib/services/computeManagement2/lib/models/oSProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Specifies the operating system settings for the virtual machine. * @@ -90,8 +88,16 @@ class OSProfile { * configuration for a Linux OS. * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public * keys used to authenticate with linux based VMs. + * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine. + *

When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. * @member {array} [secrets] Specifies set of certificates that should be * installed onto the virtual machine. + * @member {boolean} [allowExtensionOperations] Specifies whether extension + * operations should be allowed on the virtual machine.

This may only + * be set to False when no extensions are present on the virtual machine. */ constructor() { } @@ -168,6 +174,13 @@ class OSProfile { } } } + }, + allowExtensionOperations: { + required: false, + serializedName: 'allowExtensionOperations', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/computeManagement2/lib/models/recommendedMachineConfiguration.js b/lib/services/computeManagement2/lib/models/recommendedMachineConfiguration.js new file mode 100644 index 0000000000..d6ee2375a8 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/recommendedMachineConfiguration.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties describe the recommended machine configuration for this Image + * Definition. These properties are updateable. + * + */ +class RecommendedMachineConfiguration { + /** + * Create a RecommendedMachineConfiguration. + * @member {object} [vCPUs] + * @member {number} [vCPUs.min] The minimum number of the resource. + * @member {number} [vCPUs.max] The maximum number of the resource. + * @member {object} [memory] + * @member {number} [memory.min] The minimum number of the resource. + * @member {number} [memory.max] The maximum number of the resource. + */ + constructor() { + } + + /** + * Defines the metadata of RecommendedMachineConfiguration + * + * @returns {object} metadata of RecommendedMachineConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'RecommendedMachineConfiguration', + type: { + name: 'Composite', + className: 'RecommendedMachineConfiguration', + modelProperties: { + vCPUs: { + required: false, + serializedName: 'vCPUs', + type: { + name: 'Composite', + className: 'ResourceRange' + } + }, + memory: { + required: false, + serializedName: 'memory', + type: { + name: 'Composite', + className: 'ResourceRange' + } + } + } + } + }; + } +} + +module.exports = RecommendedMachineConfiguration; diff --git a/lib/services/computeManagement2/lib/models/regionalReplicationStatus.js b/lib/services/computeManagement2/lib/models/regionalReplicationStatus.js new file mode 100644 index 0000000000..53949c1697 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/regionalReplicationStatus.js @@ -0,0 +1,82 @@ +/* + * 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'; + +/** + * This is the regional replication status. + * + */ +class RegionalReplicationStatus { + /** + * Create a RegionalReplicationStatus. + * @member {string} [region] The region to which the gallery Image Version is + * being replicated to. + * @member {string} [state] This is the regional replication state. Possible + * values include: 'Unknown', 'Replicating', 'Completed', 'Failed' + * @member {string} [details] The details of the replication status. + * @member {number} [progress] It indicates progress of the replication job. + */ + constructor() { + } + + /** + * Defines the metadata of RegionalReplicationStatus + * + * @returns {object} metadata of RegionalReplicationStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'RegionalReplicationStatus', + type: { + name: 'Composite', + className: 'RegionalReplicationStatus', + modelProperties: { + region: { + required: false, + readOnly: true, + serializedName: 'region', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + details: { + required: false, + readOnly: true, + serializedName: 'details', + type: { + name: 'String' + } + }, + progress: { + required: false, + readOnly: true, + serializedName: 'progress', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = RegionalReplicationStatus; diff --git a/lib/services/computeManagement2/lib/models/replicationStatus.js b/lib/services/computeManagement2/lib/models/replicationStatus.js new file mode 100644 index 0000000000..4fa05ebeed --- /dev/null +++ b/lib/services/computeManagement2/lib/models/replicationStatus.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * This is the replication status of the gallery Image Version. + * + */ +class ReplicationStatus { + /** + * Create a ReplicationStatus. + * @member {string} [aggregatedState] This is the aggregated replication + * status based on all the regional replication status flags. Possible values + * include: 'Unknown', 'InProgress', 'Completed', 'Failed' + * @member {array} [summary] This is a summary of replication status for each + * region. + */ + constructor() { + } + + /** + * Defines the metadata of ReplicationStatus + * + * @returns {object} metadata of ReplicationStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'ReplicationStatus', + type: { + name: 'Composite', + className: 'ReplicationStatus', + modelProperties: { + aggregatedState: { + required: false, + readOnly: true, + serializedName: 'aggregatedState', + type: { + name: 'String' + } + }, + summary: { + required: false, + readOnly: true, + serializedName: 'summary', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RegionalReplicationStatusElementType', + type: { + name: 'Composite', + className: 'RegionalReplicationStatus' + } + } + } + } + } + } + }; + } +} + +module.exports = ReplicationStatus; diff --git a/lib/services/computeManagement2/lib/models/resourceRange.js b/lib/services/computeManagement2/lib/models/resourceRange.js new file mode 100644 index 0000000000..6c249385e7 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/resourceRange.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Describes the resource range. + * + */ +class ResourceRange { + /** + * Create a ResourceRange. + * @member {number} [min] The minimum number of the resource. + * @member {number} [max] The maximum number of the resource. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceRange + * + * @returns {object} metadata of ResourceRange + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceRange', + type: { + name: 'Composite', + className: 'ResourceRange', + modelProperties: { + min: { + required: false, + serializedName: 'min', + type: { + name: 'Number' + } + }, + max: { + required: false, + serializedName: 'max', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ResourceRange; diff --git a/lib/services/computeManagement2/lib/models/resourceSku.js b/lib/services/computeManagement2/lib/models/resourceSku.js index 848c0dc886..d6d21873b6 100644 --- a/lib/services/computeManagement2/lib/models/resourceSku.js +++ b/lib/services/computeManagement2/lib/models/resourceSku.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes an available Compute SKU. * diff --git a/lib/services/computeManagement2/lib/models/resourceSkuRestrictions.js b/lib/services/computeManagement2/lib/models/resourceSkuRestrictions.js index e163e71ec6..2a8db80958 100644 --- a/lib/services/computeManagement2/lib/models/resourceSkuRestrictions.js +++ b/lib/services/computeManagement2/lib/models/resourceSkuRestrictions.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes scaling information of a SKU. * diff --git a/lib/services/computeManagement2/lib/models/rollbackStatusInfo.js b/lib/services/computeManagement2/lib/models/rollbackStatusInfo.js new file mode 100644 index 0000000000..bbfa82de4f --- /dev/null +++ b/lib/services/computeManagement2/lib/models/rollbackStatusInfo.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'; + +/** + * Information about rollback on failed VM instances after a OS Upgrade + * operation. + * + */ +class RollbackStatusInfo { + /** + * Create a RollbackStatusInfo. + * @member {number} [successfullyRolledbackInstanceCount] The number of + * instances which have been successfully rolled back. + * @member {number} [failedRolledbackInstanceCount] The number of instances + * which failed to rollback. + * @member {object} [rollbackError] Error details if OS rollback failed. + * @member {array} [rollbackError.details] The Api error details + * @member {object} [rollbackError.innererror] The Api inner error + * @member {string} [rollbackError.innererror.exceptiontype] The exception + * type. + * @member {string} [rollbackError.innererror.errordetail] The internal error + * message or exception dump. + * @member {string} [rollbackError.code] The error code. + * @member {string} [rollbackError.target] The target of the particular + * error. + * @member {string} [rollbackError.message] The error message. + */ + constructor() { + } + + /** + * Defines the metadata of RollbackStatusInfo + * + * @returns {object} metadata of RollbackStatusInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'RollbackStatusInfo', + type: { + name: 'Composite', + className: 'RollbackStatusInfo', + modelProperties: { + successfullyRolledbackInstanceCount: { + required: false, + readOnly: true, + serializedName: 'successfullyRolledbackInstanceCount', + type: { + name: 'Number' + } + }, + failedRolledbackInstanceCount: { + required: false, + readOnly: true, + serializedName: 'failedRolledbackInstanceCount', + type: { + name: 'Number' + } + }, + rollbackError: { + required: false, + readOnly: true, + serializedName: 'rollbackError', + type: { + name: 'Composite', + className: 'ApiError' + } + } + } + } + }; + } +} + +module.exports = RollbackStatusInfo; diff --git a/lib/services/computeManagement2/lib/models/runCommandInput.js b/lib/services/computeManagement2/lib/models/runCommandInput.js index e245ae5fe0..0aebb6e982 100644 --- a/lib/services/computeManagement2/lib/models/runCommandInput.js +++ b/lib/services/computeManagement2/lib/models/runCommandInput.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Capture Virtual Machine parameters. * diff --git a/lib/services/computeManagement2/lib/models/runCommandResult.js b/lib/services/computeManagement2/lib/models/runCommandResult.js index f23a7d1b8c..7b5d56c547 100644 --- a/lib/services/computeManagement2/lib/models/runCommandResult.js +++ b/lib/services/computeManagement2/lib/models/runCommandResult.js @@ -10,20 +10,15 @@ 'use strict'; -const models = require('./index'); - /** - * Run command operation response. - * - * @extends models['OperationStatusResponse'] + * Class representing a RunCommandResult. */ -class RunCommandResult extends models['OperationStatusResponse'] { +class RunCommandResult { /** * Create a RunCommandResult. - * @member {object} [output] Operation output data (raw JSON) + * @member {array} [value] Run command operation response. */ constructor() { - super(); } /** @@ -40,52 +35,19 @@ class RunCommandResult extends models['OperationStatusResponse'] { name: 'Composite', className: 'RunCommandResult', modelProperties: { - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - status: { - required: false, - readOnly: true, - serializedName: 'status', - type: { - name: 'String' - } - }, - startTime: { - required: false, - readOnly: true, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - readOnly: true, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - error: { - required: false, - readOnly: true, - serializedName: 'error', - type: { - name: 'Composite', - className: 'ApiError' - } - }, - output: { + value: { required: false, - serializedName: 'properties.output', + serializedName: 'value', type: { - name: 'Object' + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } } } } diff --git a/lib/services/computeManagement2/lib/models/snapshot.js b/lib/services/computeManagement2/lib/models/snapshot.js index 0e55bb0706..0107747e28 100644 --- a/lib/services/computeManagement2/lib/models/snapshot.js +++ b/lib/services/computeManagement2/lib/models/snapshot.js @@ -39,7 +39,7 @@ class Snapshot extends models['Resource'] { * different subscription * @member {object} [creationData.imageReference] Disk source information. * @member {string} [creationData.imageReference.id] A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * @member {number} [creationData.imageReference.lun] If the disk is created * from an image's data disk, this is an index that indicates which of the * data disks in the image to use. For OS disks, this field is null. diff --git a/lib/services/computeManagement2/lib/models/snapshotUpdate.js b/lib/services/computeManagement2/lib/models/snapshotUpdate.js index c09c4e427f..967545e4f8 100644 --- a/lib/services/computeManagement2/lib/models/snapshotUpdate.js +++ b/lib/services/computeManagement2/lib/models/snapshotUpdate.js @@ -10,14 +10,11 @@ 'use strict'; -const models = require('./index'); - /** * Snapshot update resource. * - * @extends models['ResourceUpdate'] */ -class SnapshotUpdate extends models['ResourceUpdate'] { +class SnapshotUpdate { /** * Create a SnapshotUpdate. * @member {string} [osType] the Operating System type. Possible values @@ -50,9 +47,13 @@ class SnapshotUpdate extends models['ResourceUpdate'] { * Resource Id * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing * to a key or secret in KeyVault + * @member {object} [tags] Resource tags + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * @member {string} [sku.tier] The sku tier. */ constructor() { - super(); } /** @@ -69,28 +70,6 @@ class SnapshotUpdate extends models['ResourceUpdate'] { name: 'Composite', className: 'SnapshotUpdate', modelProperties: { - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sku: { - required: false, - serializedName: 'sku', - type: { - name: 'Composite', - className: 'DiskSku' - } - }, osType: { required: false, serializedName: 'properties.osType', @@ -113,6 +92,28 @@ class SnapshotUpdate extends models['ResourceUpdate'] { name: 'Composite', className: 'EncryptionSettings' } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'SnapshotSku' + } } } } diff --git a/lib/services/computeManagement2/lib/models/sshConfiguration.js b/lib/services/computeManagement2/lib/models/sshConfiguration.js index 0dc25e1a7e..dea2921dd5 100644 --- a/lib/services/computeManagement2/lib/models/sshConfiguration.js +++ b/lib/services/computeManagement2/lib/models/sshConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * SSH configuration for Linux based VMs running on Azure * diff --git a/lib/services/computeManagement2/lib/models/storageProfile.js b/lib/services/computeManagement2/lib/models/storageProfile.js index 38b108fcd0..cf4f2ce1e7 100644 --- a/lib/services/computeManagement2/lib/models/storageProfile.js +++ b/lib/services/computeManagement2/lib/models/storageProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Specifies the storage settings for the virtual machine disks. * @@ -79,6 +77,11 @@ class StorageProfile { * 'ReadOnly', 'ReadWrite' * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether * writeAccelerator should be enabled or disabled on the disk. + * @member {object} [osDisk.diffDiskSettings] Specifies the differencing Disk + * Settings for the operating system disk used by the virtual machine. + * @member {string} [osDisk.diffDiskSettings.option] Specifies the + * differencing disk settings for operating system disk. Possible values + * include: 'Local' * @member {string} [osDisk.createOption] Specifies how the virtual machine * should be created.

Possible values are:

**Attach** \u2013 * This value is used when you are using a specialized disk to create the @@ -89,14 +92,14 @@ class StorageProfile { * previously described. Possible values include: 'FromImage', 'Empty', * 'Attach' * @member {number} [osDisk.diskSizeGB] Specifies the size of an empty data - * disk in gigabytes. This element can be used to overwrite the name of the + * disk in gigabytes. This element can be used to overwrite the size of the * disk in a virtual machine image.

This value cannot be larger than * 1023 GB * @member {object} [osDisk.managedDisk] The managed disk parameters. * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * storage account type for the managed disk. NOTE: UltraSSD_LRS can only be + * used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [dataDisks] Specifies the parameters that are used to add * a data disk to a virtual machine.

For more information about * disks, see [About disks and VHDs for Azure virtual diff --git a/lib/services/computeManagement2/lib/models/targetRegion.js b/lib/services/computeManagement2/lib/models/targetRegion.js new file mode 100644 index 0000000000..1236907427 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/targetRegion.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the target region information. + * + */ +class TargetRegion { + /** + * Create a TargetRegion. + * @member {string} name The name of the region. + * @member {number} [regionalReplicaCount] The number of replicas of the + * Image Version to be created per region. This property is updateable. + */ + constructor() { + } + + /** + * Defines the metadata of TargetRegion + * + * @returns {object} metadata of TargetRegion + * + */ + mapper() { + return { + required: false, + serializedName: 'TargetRegion', + type: { + name: 'Composite', + className: 'TargetRegion', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + regionalReplicaCount: { + required: false, + serializedName: 'regionalReplicaCount', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = TargetRegion; diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js new file mode 100644 index 0000000000..cc5a4f043b --- /dev/null +++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.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'; + +/** + * Virtual Machine Scale Set OS Upgrade History operation response. + * + */ +class UpgradeOperationHistoricalStatusInfo { + /** + * Create a UpgradeOperationHistoricalStatusInfo. + * @member {object} [properties] Information about the properties of the + * upgrade operation. + * @member {object} [properties.runningStatus] Information about the overall + * status of the upgrade operation. + * @member {string} [properties.runningStatus.code] Code indicating the + * current status of the upgrade. Possible values include: 'RollingForward', + * 'Cancelled', 'Completed', 'Faulted' + * @member {date} [properties.runningStatus.startTime] Start time of the + * upgrade. + * @member {date} [properties.runningStatus.endTime] End time of the upgrade. + * @member {object} [properties.progress] Counts of the VM's in each state. + * @member {number} [properties.progress.successfulInstanceCount] The number + * of instances that have been successfully upgraded. + * @member {number} [properties.progress.failedInstanceCount] The number of + * instances that have failed to be upgraded successfully. + * @member {number} [properties.progress.inProgressInstanceCount] The number + * of instances that are currently being upgraded. + * @member {number} [properties.progress.pendingInstanceCount] The number of + * instances that have not yet begun to be upgraded. + * @member {object} [properties.error] Error Details for this upgrade if + * there are any. + * @member {array} [properties.error.details] The Api error details + * @member {object} [properties.error.innererror] The Api inner error + * @member {string} [properties.error.innererror.exceptiontype] The exception + * type. + * @member {string} [properties.error.innererror.errordetail] The internal + * error message or exception dump. + * @member {string} [properties.error.code] The error code. + * @member {string} [properties.error.target] The target of the particular + * error. + * @member {string} [properties.error.message] The error message. + * @member {string} [properties.startedBy] Invoker of the Upgrade Operation. + * Possible values include: 'Unknown', 'User', 'Platform' + * @member {object} [properties.targetImageReference] Image Reference details + * @member {string} [properties.targetImageReference.publisher] The image + * publisher. + * @member {string} [properties.targetImageReference.offer] Specifies the + * offer of the platform image or marketplace image used to create the + * virtual machine. + * @member {string} [properties.targetImageReference.sku] The image SKU. + * @member {string} [properties.targetImageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {object} [properties.rollbackInfo] Information about OS rollback + * if performed + * @member {number} + * [properties.rollbackInfo.successfullyRolledbackInstanceCount] The number + * of instances which have been successfully rolled back. + * @member {number} [properties.rollbackInfo.failedRolledbackInstanceCount] + * The number of instances which failed to rollback. + * @member {object} [properties.rollbackInfo.rollbackError] Error details if + * OS rollback failed. + * @member {array} [properties.rollbackInfo.rollbackError.details] The Api + * error details + * @member {object} [properties.rollbackInfo.rollbackError.innererror] The + * Api inner error + * @member {string} + * [properties.rollbackInfo.rollbackError.innererror.exceptiontype] The + * exception type. + * @member {string} + * [properties.rollbackInfo.rollbackError.innererror.errordetail] The + * internal error message or exception dump. + * @member {string} [properties.rollbackInfo.rollbackError.code] The error + * code. + * @member {string} [properties.rollbackInfo.rollbackError.target] The target + * of the particular error. + * @member {string} [properties.rollbackInfo.rollbackError.message] The error + * message. + * @member {string} [type] Resource type + * @member {string} [location] Resource location + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoricalStatusInfo + * + * @returns {object} metadata of UpgradeOperationHistoricalStatusInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfo', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfo', + modelProperties: { + properties: { + required: false, + readOnly: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfoProperties' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + readOnly: true, + serializedName: 'location', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoricalStatusInfo; diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js new file mode 100644 index 0000000000..2b6ff23fa5 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js @@ -0,0 +1,155 @@ +/* + * 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'; + +/** + * Describes each OS upgrade on the Virtual Machine Scale Set. + * + */ +class UpgradeOperationHistoricalStatusInfoProperties { + /** + * Create a UpgradeOperationHistoricalStatusInfoProperties. + * @member {object} [runningStatus] Information about the overall status of + * the upgrade operation. + * @member {string} [runningStatus.code] Code indicating the current status + * of the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {date} [runningStatus.endTime] End time of the upgrade. + * @member {object} [progress] Counts of the VM's in each state. + * @member {number} [progress.successfulInstanceCount] The number of + * instances that have been successfully upgraded. + * @member {number} [progress.failedInstanceCount] The number of instances + * that have failed to be upgraded successfully. + * @member {number} [progress.inProgressInstanceCount] The number of + * instances that are currently being upgraded. + * @member {number} [progress.pendingInstanceCount] The number of instances + * that have not yet begun to be upgraded. + * @member {object} [error] Error Details for this upgrade if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + * @member {string} [startedBy] Invoker of the Upgrade Operation. Possible + * values include: 'Unknown', 'User', 'Platform' + * @member {object} [targetImageReference] Image Reference details + * @member {string} [targetImageReference.publisher] The image publisher. + * @member {string} [targetImageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [targetImageReference.sku] The image SKU. + * @member {string} [targetImageReference.version] Specifies the version of + * the platform image or marketplace image used to create the virtual + * machine. The allowed formats are Major.Minor.Build or 'latest'. Major, + * Minor, and Build are decimal numbers. Specify 'latest' to use the latest + * version of an image available at deploy time. Even if you use 'latest', + * the VM image will not automatically update after deploy time even if a new + * version becomes available. + * @member {object} [rollbackInfo] Information about OS rollback if performed + * @member {number} [rollbackInfo.successfullyRolledbackInstanceCount] The + * number of instances which have been successfully rolled back. + * @member {number} [rollbackInfo.failedRolledbackInstanceCount] The number + * of instances which failed to rollback. + * @member {object} [rollbackInfo.rollbackError] Error details if OS rollback + * failed. + * @member {array} [rollbackInfo.rollbackError.details] The Api error details + * @member {object} [rollbackInfo.rollbackError.innererror] The Api inner + * error + * @member {string} [rollbackInfo.rollbackError.innererror.exceptiontype] The + * exception type. + * @member {string} [rollbackInfo.rollbackError.innererror.errordetail] The + * internal error message or exception dump. + * @member {string} [rollbackInfo.rollbackError.code] The error code. + * @member {string} [rollbackInfo.rollbackError.target] The target of the + * particular error. + * @member {string} [rollbackInfo.rollbackError.message] The error message. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoricalStatusInfoProperties + * + * @returns {object} metadata of UpgradeOperationHistoricalStatusInfoProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfoProperties', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfoProperties', + modelProperties: { + runningStatus: { + required: false, + readOnly: true, + serializedName: 'runningStatus', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoryStatus' + } + }, + progress: { + required: false, + readOnly: true, + serializedName: 'progress', + type: { + name: 'Composite', + className: 'RollingUpgradeProgressInfo' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ApiError' + } + }, + startedBy: { + required: false, + readOnly: true, + serializedName: 'startedBy', + type: { + name: 'Enum', + allowedValues: [ 'Unknown', 'User', 'Platform' ] + } + }, + targetImageReference: { + required: false, + readOnly: true, + serializedName: 'targetImageReference', + type: { + name: 'Composite', + className: 'ImageReference' + } + }, + rollbackInfo: { + required: false, + readOnly: true, + serializedName: 'rollbackInfo', + type: { + name: 'Composite', + className: 'RollbackStatusInfo' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoricalStatusInfoProperties; diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js new file mode 100644 index 0000000000..989c1480d4 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.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'; + +/** + * Information about the current running state of the overall upgrade. + * + */ +class UpgradeOperationHistoryStatus { + /** + * Create a UpgradeOperationHistoryStatus. + * @member {string} [code] Code indicating the current status of the upgrade. + * Possible values include: 'RollingForward', 'Cancelled', 'Completed', + * 'Faulted' + * @member {date} [startTime] Start time of the upgrade. + * @member {date} [endTime] End time of the upgrade. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoryStatus + * + * @returns {object} metadata of UpgradeOperationHistoryStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoryStatus', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoryStatus', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'Enum', + allowedValues: [ 'RollingForward', 'Cancelled', 'Completed', 'Faulted' ] + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoryStatus; diff --git a/lib/services/computeManagement2/lib/models/upgradePolicy.js b/lib/services/computeManagement2/lib/models/upgradePolicy.js index eb5f4643c8..0bdfe637e9 100644 --- a/lib/services/computeManagement2/lib/models/upgradePolicy.js +++ b/lib/services/computeManagement2/lib/models/upgradePolicy.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes an upgrade policy - automatic, manual, or rolling. * @@ -51,9 +49,15 @@ class UpgradePolicy { * time between completing the update for all virtual machines in one batch * and starting the next batch. The time duration should be specified in ISO * 8601 format. The default value is 0 seconds (PT0S). - * @member {boolean} [automaticOSUpgrade] Whether OS upgrades should - * automatically be applied to scale set instances in a rolling fashion when - * a newer version of the image becomes available. + * @member {object} [automaticOSUpgradePolicy] Configuration parameters used + * for performing automatic OS Upgrade. + * @member {boolean} [automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * @member {boolean} [automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. */ constructor() { } @@ -88,11 +92,12 @@ class UpgradePolicy { className: 'RollingUpgradePolicy' } }, - automaticOSUpgrade: { + automaticOSUpgradePolicy: { required: false, - serializedName: 'automaticOSUpgrade', + serializedName: 'automaticOSUpgradePolicy', type: { - name: 'Boolean' + name: 'Composite', + className: 'AutomaticOSUpgradePolicy' } } } diff --git a/lib/services/computeManagement2/lib/models/usage.js b/lib/services/computeManagement2/lib/models/usage.js index 8566e4ebee..c840e66a99 100644 --- a/lib/services/computeManagement2/lib/models/usage.js +++ b/lib/services/computeManagement2/lib/models/usage.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes Compute Resource Usage. * diff --git a/lib/services/computeManagement2/lib/models/vaultSecretGroup.js b/lib/services/computeManagement2/lib/models/vaultSecretGroup.js index e1a7e3f5ff..9922059631 100644 --- a/lib/services/computeManagement2/lib/models/vaultSecretGroup.js +++ b/lib/services/computeManagement2/lib/models/vaultSecretGroup.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a set of certificates which are all in the same Key Vault. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachine.js b/lib/services/computeManagement2/lib/models/virtualMachine.js index dfb237a362..0487bd8b55 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachine.js +++ b/lib/services/computeManagement2/lib/models/virtualMachine.js @@ -170,6 +170,12 @@ class VirtualMachine extends models['Resource'] { * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] * Specifies whether writeAccelerator should be enabled or disabled on the * disk. + * @member {object} [storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the + * virtual machine. + * @member {string} [storageProfile.osDisk.diffDiskSettings.option] Specifies + * the differencing disk settings for operating system disk. Possible values + * include: 'Local' * @member {string} [storageProfile.osDisk.createOption] Specifies how the * virtual machine should be created.

Possible values are:

* **Attach** \u2013 This value is used when you are using a specialized disk @@ -181,18 +187,26 @@ class VirtualMachine extends models['Resource'] { * 'Empty', 'Attach' * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of * an empty data disk in gigabytes. This element can be used to overwrite the - * name of the disk in a virtual machine image.

This value cannot be + * size of the disk in a virtual machine image.

This value cannot be * larger than 1023 GB * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that * are used to add a data disk to a virtual machine.

For more * information about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * @member {boolean} [additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks + * with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks + * with storage account type UltraSSD_LRS can be added to a virtual machine + * or virtual machine scale set only if this property is enabled. * @member {object} [osProfile] Specifies the operating system settings for * the virtual machine. * @member {string} [osProfile.computerName] Specifies the host OS name of @@ -271,8 +285,18 @@ class VirtualMachine extends models['Resource'] { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machine. + * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether + * extension operations should be allowed on the virtual machine. + *

This may only be set to False when no extensions are present on + * the virtual machine. * @member {object} [networkProfile] Specifies the network interfaces of the * virtual machine. * @member {array} [networkProfile.networkInterfaces] Specifies the list of @@ -282,9 +306,8 @@ class VirtualMachine extends models['Resource'] { * settings state.

Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is * a debugging feature which allows you to view Console Output and Screenshot - * to diagnose VM status.

For Linux Virtual Machines, you can easily - * view the output of your console log.

For both Windows and Linux - * virtual machines, Azure also enables you to see a screenshot of the VM + * to diagnose VM status.

You can easily view the output of your + * console log.

Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether * boot diagnostics should be enabled on the Virtual Machine. @@ -353,14 +376,26 @@ class VirtualMachine extends models['Resource'] { * @member {array} [instanceView.extensions] The extensions information. * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot - * to diagnose VM status.

For Linux Virtual Machines, you can easily - * view the output of your console log.

For both Windows and Linux - * virtual machines, Azure also enables you to see a screenshot of the VM + * to diagnose VM status.

You can easily view the output of your + * console log.

Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] * The console screenshot blob URI. * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] * The Linux serial console log blob Uri. + * @member {object} [instanceView.bootDiagnostics.status] The boot + * diagnostics status information for the VM.

NOTE: It will be set + * only if there are errors encountered in enabling boot diagnostics. + * @member {string} [instanceView.bootDiagnostics.status.code] The status + * code. + * @member {string} [instanceView.bootDiagnostics.status.level] The level + * code. Possible values include: 'Info', 'Warning', 'Error' + * @member {string} [instanceView.bootDiagnostics.status.displayStatus] The + * short localizable label for the status. + * @member {string} [instanceView.bootDiagnostics.status.message] The + * detailed status message, including for alerts and error messages. + * @member {date} [instanceView.bootDiagnostics.status.time] The time of the + * status. * @member {array} [instanceView.statuses] The resource status information. * @member {string} [licenseType] Specifies that the image or disk that is * being used was licensed on-premises. This element is only used for images @@ -389,10 +424,10 @@ class VirtualMachine extends models['Resource'] { * type 'None' will remove any identities from the virtual machine. Possible * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, * UserAssigned', 'None' - * @member {array} [identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * @member {array} [zones] The virtual machine zones. */ constructor() { @@ -482,6 +517,14 @@ class VirtualMachine extends models['Resource'] { className: 'StorageProfile' } }, + additionalCapabilities: { + required: false, + serializedName: 'properties.additionalCapabilities', + type: { + name: 'Composite', + className: 'AdditionalCapabilities' + } + }, osProfile: { required: false, serializedName: 'properties.osProfile', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js index 93bc2c51be..25fe929ef7 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The instance view of the VM Agent running on the virtual machine. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js b/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js index 82d3ef372b..67facb1d8a 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js @@ -13,14 +13,18 @@ const models = require('./index'); /** - * Resource Id. + * Output of virtual machine capture operation. * * @extends models['SubResource'] */ class VirtualMachineCaptureResult extends models['SubResource'] { /** * Create a VirtualMachineCaptureResult. - * @member {object} [output] Operation output data (raw JSON) + * @member {string} [schema] the schema of the captured virtual machine + * @member {string} [contentVersion] the version of the content + * @member {object} [parameters] parameters of the captured virtual machine + * @member {array} [resources] a list of resource items of the captured + * virtual machine */ constructor() { super(); @@ -47,12 +51,44 @@ class VirtualMachineCaptureResult extends models['SubResource'] { name: 'String' } }, - output: { + schema: { required: false, - serializedName: 'properties.output', + readOnly: true, + serializedName: '$schema', + type: { + name: 'String' + } + }, + contentVersion: { + required: false, + readOnly: true, + serializedName: 'contentVersion', + type: { + name: 'String' + } + }, + parameters: { + required: false, + readOnly: true, + serializedName: 'parameters', type: { name: 'Object' } + }, + resources: { + required: false, + readOnly: true, + serializedName: 'resources', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Object' + } + } + } } } } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js index a4ce866b57..4900bc611b 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The instance view of a virtual machine extension handler. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js index cdd03e40d8..5e49fb98fa 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The instance view of a virtual machine extension. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js index f3d08ea382..f405c3d0f6 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The List Extension operation response * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineHealthStatus.js b/lib/services/computeManagement2/lib/models/virtualMachineHealthStatus.js index 0ccd89fedd..8a4fe2090e 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineHealthStatus.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineHealthStatus.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The health status of the VM. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineIdentity.js b/lib/services/computeManagement2/lib/models/virtualMachineIdentity.js index 741dcde48e..bc329d687a 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineIdentity.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineIdentity.js @@ -29,10 +29,10 @@ class VirtualMachineIdentity { * will remove any identities from the virtual machine. Possible values * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' - * @member {array} [identityIds] The list of user identities associated with - * the Virtual Machine. The user identity references will be ARM resource ids - * in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [userAssignedIdentities] The list of user identities + * associated with the Virtual Machine. The user identity dictionary key + * references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ constructor() { } @@ -75,16 +75,17 @@ class VirtualMachineIdentity { allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ] } }, - identityIds: { + userAssignedIdentities: { required: false, - serializedName: 'identityIds', + serializedName: 'userAssignedIdentities', type: { - name: 'Sequence', - element: { + name: 'Dictionary', + value: { required: false, - serializedName: 'StringElementType', + serializedName: 'VirtualMachineIdentityUserAssignedIdentitiesValueElementType', type: { - name: 'String' + name: 'Composite', + className: 'VirtualMachineIdentityUserAssignedIdentitiesValue' } } } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineIdentityUserAssignedIdentitiesValue.js b/lib/services/computeManagement2/lib/models/virtualMachineIdentityUserAssignedIdentitiesValue.js new file mode 100644 index 0000000000..09033f5b29 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/virtualMachineIdentityUserAssignedIdentitiesValue.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a VirtualMachineIdentityUserAssignedIdentitiesValue. + */ +class VirtualMachineIdentityUserAssignedIdentitiesValue { + /** + * Create a VirtualMachineIdentityUserAssignedIdentitiesValue. + * @member {string} [principalId] The principal id of user assigned identity. + * @member {string} [clientId] The client id of user assigned identity. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineIdentityUserAssignedIdentitiesValue + * + * @returns {object} metadata of VirtualMachineIdentityUserAssignedIdentitiesValue + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineIdentity_userAssignedIdentitiesValue', + type: { + name: 'Composite', + className: 'VirtualMachineIdentityUserAssignedIdentitiesValue', + modelProperties: { + principalId: { + required: false, + readOnly: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + clientId: { + required: false, + readOnly: true, + serializedName: 'clientId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineIdentityUserAssignedIdentitiesValue; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js index aa4805f496..05b74a3195 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The instance view of a virtual machine. * @@ -58,14 +56,24 @@ class VirtualMachineInstanceView { * @member {array} [extensions] The extensions information. * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature * which allows you to view Console Output and Screenshot to diagnose VM - * status.

For Linux Virtual Machines, you can easily view the - * output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * status.

You can easily view the output of your console log. + *

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console * screenshot blob URI. * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux * serial console log blob Uri. + * @member {object} [bootDiagnostics.status] The boot diagnostics status + * information for the VM.

NOTE: It will be set only if there are + * errors encountered in enabling boot diagnostics. + * @member {string} [bootDiagnostics.status.code] The status code. + * @member {string} [bootDiagnostics.status.level] The level code. Possible + * values include: 'Info', 'Warning', 'Error' + * @member {string} [bootDiagnostics.status.displayStatus] The short + * localizable label for the status. + * @member {string} [bootDiagnostics.status.message] The detailed status + * message, including for alerts and error messages. + * @member {date} [bootDiagnostics.status.time] The time of the status. * @member {array} [statuses] The resource status information. */ constructor() { diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js index 58136094b6..fd29c2b1da 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js @@ -76,9 +76,16 @@ class VirtualMachineScaleSet extends models['Resource'] { * between completing the update for all virtual machines in one batch and * starting the next batch. The time duration should be specified in ISO 8601 * format. The default value is 0 seconds (PT0S). - * @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades - * should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @member {object} [upgradePolicy.automaticOSUpgradePolicy] Configuration + * parameters used for performing automatic OS Upgrade. + * @member {boolean} + * [upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] Whether + * OS upgrades should automatically be applied to scale set instances in a + * rolling fashion when a newer version of the image becomes available. + * Default value is false. + * @member {boolean} + * [upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] Whether + * OS image rollback feature should be disabled. Default value is false. * @member {object} [virtualMachineProfile] The virtual machine profile. * @member {object} [virtualMachineProfile.osProfile] Specifies the operating * system settings for the virtual machines in the scale set. @@ -165,6 +172,13 @@ class VirtualMachineScaleSet extends models['Resource'] { * @member {array} * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. + * @member {boolean} + * [virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. * @member {array} [virtualMachineProfile.osProfile.secrets] Specifies set of * certificates that should be installed onto the virtual machines in the * scale set. @@ -217,6 +231,18 @@ class VirtualMachineScaleSet extends models['Resource'] { * image, you also use the imageReference element described above. If you are * using a marketplace image, you also use the plan element previously * described. Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {object} + * [virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] Specifies + * the differencing Disk Settings for the operating system disk used by the + * virtual machine scale set. + * @member {string} + * [virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. + * Possible values include: 'Local' + * @member {number} [virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

This value cannot be larger than 1023 GB * @member {string} [virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the * disk if creating a VM from user-image or a specialized VHD.

@@ -235,14 +261,26 @@ class VirtualMachineScaleSet extends models['Resource'] { * The managed disk parameters. * @member {string} * [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [virtualMachineProfile.storageProfile.dataDisks] Specifies * the parameters that are used to add data disks to the virtual machines in * the scale set.

For more information about disks, see [About disks * and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [virtualMachineProfile.additionalCapabilities] Specifies + * additional capabilities enabled or disabled on the virtual machine in the + * scale set. For instance: whether the virtual machine has the capability to + * support attaching managed data disks with UltraSSD_LRS storage account + * type. + * @member {boolean} + * [virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] The flag + * that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. * @member {object} [virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -262,9 +300,8 @@ class VirtualMachineScaleSet extends models['Resource'] { * @member {object} * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

For Linux Virtual Machines, - * you can easily view the output of your console log.

For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

You can easily view the + * output of your console log.

Azure also enables you to see a * screenshot of the VM from the hypervisor. * @member {boolean} * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] Whether @@ -291,6 +328,10 @@ class VirtualMachineScaleSet extends models['Resource'] { * @member {string} [virtualMachineProfile.priority] Specifies the priority * for the virtual machines in the scale set.

Minimum api-version: * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * @member {string} [virtualMachineProfile.evictionPolicy] Specifies the + * eviction policy for virtual machines in a low priority scale set. + *

Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' * @member {string} [provisioningState] The provisioning state, which only * appears in the response. * @member {boolean} [overprovision] Specifies whether the Virtual Machine @@ -317,10 +358,10 @@ class VirtualMachineScaleSet extends models['Resource'] { * type 'None' will remove any identities from the virtual machine scale set. * Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' - * @member {array} [identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * @member {array} [zones] The virtual machine scale set zones. */ constructor() { diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetDataDisk.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetDataDisk.js index 764ded8a19..3354ee641a 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetDataDisk.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetDataDisk.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set data disk. * @@ -33,12 +31,13 @@ class VirtualMachineScaleSetDataDisk { * @member {string} createOption The create option. Possible values include: * 'FromImage', 'Empty', 'Attach' * @member {number} [diskSizeGB] Specifies the size of an empty data disk in - * gigabytes. This element can be used to overwrite the name of the disk in a + * gigabytes. This element can be used to overwrite the size of the disk in a * virtual machine image.

This value cannot be larger than 1023 GB * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used + * with data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ constructor() { } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js index fa2d107f7e..d27660bf3a 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set extension profile. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js index acba9a2b2c..35be769b56 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js @@ -38,6 +38,12 @@ class VirtualMachineScaleSetIPConfiguration extends models['SubResource'] { * [publicIPAddressConfiguration.dnsSettings.domainNameLabel] The Domain name * label.The concatenation of the domain name label and vm index will be the * domain name labels of the PublicIPAddress resources that will be created + * @member {array} [publicIPAddressConfiguration.ipTags] The list of IP tags + * associated with the public IP address. + * @member {object} [publicIPAddressConfiguration.publicIPPrefix] The + * PublicIPPrefix from which to allocate publicIP addresses. + * @member {string} [publicIPAddressConfiguration.publicIPPrefix.id] Resource + * Id * @member {string} [privateIPAddressVersion] Available from Api-Version * 2017-03-30 onwards, it represents whether the specific ipconfiguration is * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and @@ -46,6 +52,8 @@ class VirtualMachineScaleSetIPConfiguration extends models['SubResource'] { * of references to backend address pools of application gateways. A scale * set can reference backend address pools of multiple application gateways. * Multiple scale sets cannot use the same application gateway. + * @member {array} [applicationSecurityGroups] Specifies an array of + * references to application security group. * @member {array} [loadBalancerBackendAddressPools] Specifies an array of * references to backend address pools of load balancers. A scale set can * reference backend address pools of one public and one internal load @@ -132,6 +140,21 @@ class VirtualMachineScaleSetIPConfiguration extends models['SubResource'] { } } }, + applicationSecurityGroups: { + required: false, + serializedName: 'properties.applicationSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, loadBalancerBackendAddressPools: { required: false, serializedName: 'properties.loadBalancerBackendAddressPools', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentity.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentity.js index c820acdcf9..c57257efe5 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentity.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentity.js @@ -29,10 +29,10 @@ class VirtualMachineScaleSetIdentity { * type 'None' will remove any identities from the virtual machine scale set. * Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' - * @member {array} [identityIds] The list of user identities associated with - * the virtual machine scale set. The user identity references will be ARM - * resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [userAssignedIdentities] The list of user identities + * associated with the virtual machine scale set. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ constructor() { } @@ -75,16 +75,17 @@ class VirtualMachineScaleSetIdentity { allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ] } }, - identityIds: { + userAssignedIdentities: { required: false, - serializedName: 'identityIds', + serializedName: 'userAssignedIdentities', type: { - name: 'Sequence', - element: { + name: 'Dictionary', + value: { required: false, - serializedName: 'StringElementType', + serializedName: 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValueElementType', type: { - name: 'String' + name: 'Composite', + className: 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue' } } } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentityUserAssignedIdentitiesValue.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentityUserAssignedIdentitiesValue.js new file mode 100644 index 0000000000..0752bf5253 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentityUserAssignedIdentitiesValue.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + */ +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue { + /** + * Create a VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + * @member {string} [principalId] The principal id of user assigned identity. + * @member {string} [clientId] The client id of user assigned identity. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue + * + * @returns {object} metadata of VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetIdentity_userAssignedIdentitiesValue', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue', + modelProperties: { + principalId: { + required: false, + readOnly: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + clientId: { + required: false, + readOnly: true, + serializedName: 'clientId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js index b1ef6a6a1f..9229eec790 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The instance view of a virtual machine scale set. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js index c5755dfc84..c852cb303e 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Instance view statuses summary for virtual machines of a virtual machine * scale set. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIpTag.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIpTag.js new file mode 100644 index 0000000000..f133b20ed3 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIpTag.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains the IP tag associated with the public IP address. + * + */ +class VirtualMachineScaleSetIpTag { + /** + * Create a VirtualMachineScaleSetIpTag. + * @member {string} [ipTagType] IP tag type. Example: FirstPartyUsage. + * @member {string} [tag] IP tag associated with the public IP. Example: SQL, + * Storage etc. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetIpTag + * + * @returns {object} metadata of VirtualMachineScaleSetIpTag + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetIpTag', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetIpTag', + modelProperties: { + ipTagType: { + required: false, + serializedName: 'ipTagType', + type: { + name: 'String' + } + }, + tag: { + required: false, + serializedName: 'tag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetIpTag; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js new file mode 100644 index 0000000000..67be7c8893 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.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'; + +/** + * List of Virtual Machine Scale Set OS Upgrade History operation response. + */ +class VirtualMachineScaleSetListOSUpgradeHistory extends Array { + /** + * Create a VirtualMachineScaleSetListOSUpgradeHistory. + * @member {string} [nextLink] The uri to fetch the next page of OS Upgrade + * History. Call ListNext() with this to fetch the next page of history of + * upgrades. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetListOSUpgradeHistory + * + * @returns {object} metadata of VirtualMachineScaleSetListOSUpgradeHistory + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetListOSUpgradeHistory', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetListOSUpgradeHistory', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfoElementType', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfo' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetListOSUpgradeHistory; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetManagedDiskParameters.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetManagedDiskParameters.js index a11dae5d33..6ffd999d31 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetManagedDiskParameters.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetManagedDiskParameters.js @@ -18,8 +18,9 @@ class VirtualMachineScaleSetManagedDiskParameters { /** * Create a VirtualMachineScaleSetManagedDiskParameters. * @member {string} [storageAccountType] Specifies the storage account type - * for the managed disk. Possible values are: Standard_LRS or Premium_LRS. - * Possible values include: 'Standard_LRS', 'Premium_LRS' + * for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, + * it cannot be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ constructor() { } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js index f3b8e80b4e..6b069ffceb 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set network profile. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js index 737b7c9db1..d1cbfc3320 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set operating system disk. * @@ -34,6 +32,15 @@ class VirtualMachineScaleSetOSDisk { * use the imageReference element described above. If you are using a * marketplace image, you also use the plan element previously described. * Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {object} [diffDiskSettings] Specifies the differencing Disk + * Settings for the operating system disk used by the virtual machine scale + * set. + * @member {string} [diffDiskSettings.option] Specifies the differencing disk + * settings for operating system disk. Possible values include: 'Local' + * @member {number} [diskSizeGB] Specifies the size of the operating system + * disk in gigabytes. This element can be used to overwrite the size of the + * disk in a virtual machine image.

This value cannot be larger than + * 1023 GB * @member {string} [osType] This property allows you to specify the type of * the OS that is included in the disk if creating a VM from user-image or a * specialized VHD.

Possible values are:

**Windows** @@ -45,8 +52,9 @@ class VirtualMachineScaleSetOSDisk { * to store operating system disks for the scale set. * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used + * with data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ constructor() { } @@ -94,6 +102,21 @@ class VirtualMachineScaleSetOSDisk { name: 'String' } }, + diffDiskSettings: { + required: false, + serializedName: 'diffDiskSettings', + type: { + name: 'Composite', + className: 'DiffDiskSettings' + } + }, + diskSizeGB: { + required: false, + serializedName: 'diskSizeGB', + type: { + name: 'Number' + } + }, osType: { required: false, serializedName: 'osType', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js index 83622b758e..5520c6f135 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set OS profile. * @@ -88,6 +86,11 @@ class VirtualMachineScaleSetOSProfile { * configuration for a Linux OS. * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public * keys used to authenticate with linux based VMs. + * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine. + *

When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. * @member {array} [secrets] Specifies set of certificates that should be * installed onto the virtual machines in the scale set. */ diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js index 7b99a1abf7..d46e68fd16 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machines scale set IP Configuration's PublicIPAddress * configuration @@ -28,6 +26,11 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration { * @member {string} [dnsSettings.domainNameLabel] The Domain name label.The * concatenation of the domain name label and vm index will be the domain * name labels of the PublicIPAddress resources that will be created + * @member {array} [ipTags] The list of IP tags associated with the public IP + * address. + * @member {object} [publicIPPrefix] The PublicIPPrefix from which to + * allocate publicIP addresses. + * @member {string} [publicIPPrefix.id] Resource Id */ constructor() { } @@ -67,6 +70,29 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration { name: 'Composite', className: 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings' } + }, + ipTags: { + required: false, + serializedName: 'properties.ipTags', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetIpTagElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetIpTag' + } + } + } + }, + publicIPPrefix: { + required: false, + serializedName: 'properties.publicIPPrefix', + type: { + name: 'Composite', + className: 'SubResource' + } } } } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js index 6fe583507e..9f9719323c 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes an available virtual machine scale set sku. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js index b8ab9a175b..9baa4fc435 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set storage profile. * @@ -54,6 +52,16 @@ class VirtualMachineScaleSetStorageProfile { * use the imageReference element described above. If you are using a * marketplace image, you also use the plan element previously described. * Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {object} [osDisk.diffDiskSettings] Specifies the differencing Disk + * Settings for the operating system disk used by the virtual machine scale + * set. + * @member {string} [osDisk.diffDiskSettings.option] Specifies the + * differencing disk settings for operating system disk. Possible values + * include: 'Local' + * @member {number} [osDisk.diskSizeGB] Specifies the size of the operating + * system disk in gigabytes. This element can be used to overwrite the size + * of the disk in a virtual machine image.

This value cannot be + * larger than 1023 GB * @member {string} [osDisk.osType] This property allows you to specify the * type of the OS that is included in the disk if creating a VM from * user-image or a specialized VHD.

Possible values are:

@@ -66,9 +74,9 @@ class VirtualMachineScaleSetStorageProfile { * are used to store operating system disks for the scale set. * @member {object} [osDisk.managedDisk] The managed disk parameters. * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * storage account type for the managed disk. NOTE: UltraSSD_LRS can only be + * used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [dataDisks] Specifies the parameters that are used to add * data disks to the virtual machines in the scale set.

For more * information about disks, see [About disks and VHDs for Azure virtual diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdate.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdate.js index 693917b226..9479f32f11 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdate.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdate.js @@ -71,9 +71,16 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] { * between completing the update for all virtual machines in one batch and * starting the next batch. The time duration should be specified in ISO 8601 * format. The default value is 0 seconds (PT0S). - * @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades - * should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @member {object} [upgradePolicy.automaticOSUpgradePolicy] Configuration + * parameters used for performing automatic OS Upgrade. + * @member {boolean} + * [upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] Whether + * OS upgrades should automatically be applied to scale set instances in a + * rolling fashion when a newer version of the image becomes available. + * Default value is false. + * @member {boolean} + * [upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] Whether + * OS image rollback feature should be disabled. Default value is false. * @member {object} [virtualMachineProfile] The virtual machine profile. * @member {object} [virtualMachineProfile.osProfile] The virtual machine * scale set OS profile. @@ -115,6 +122,13 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] { * @member {array} * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. + * @member {boolean} + * [virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. * @member {array} [virtualMachineProfile.osProfile.secrets] The List of * certificates for addition to the VM. * @member {object} [virtualMachineProfile.storageProfile] The virtual @@ -146,6 +160,10 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] { * [virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] * Specifies whether writeAccelerator should be enabled or disabled on the * disk. + * @member {number} [virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

This value cannot be larger than 1023 GB * @member {object} [virtualMachineProfile.storageProfile.osDisk.image] The * Source User Image VirtualHardDisk. This VirtualHardDisk will be copied * before using it to attach to the Virtual Machine. If SourceImage is @@ -159,9 +177,10 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] { * The managed disk parameters. * @member {string} * [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [virtualMachineProfile.storageProfile.dataDisks] The data * disks. * @member {object} [virtualMachineProfile.networkProfile] The virtual @@ -174,9 +193,8 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] { * @member {object} * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

For Linux Virtual Machines, - * you can easily view the output of your console log.

For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

You can easily view the + * output of your console log.

Azure also enables you to see a * screenshot of the VM from the hypervisor. * @member {boolean} * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] Whether @@ -209,10 +227,10 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] { * type 'None' will remove any identities from the virtual machine scale set. * Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' - * @member {array} [identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ constructor() { super(); diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js index 861de94e23..602dae90fc 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js @@ -44,6 +44,8 @@ class VirtualMachineScaleSetUpdateIPConfiguration extends models['SubResource'] * 'IPv6'. Possible values include: 'IPv4', 'IPv6' * @member {array} [applicationGatewayBackendAddressPools] The application * gateway backend address pools. + * @member {array} [applicationSecurityGroups] Specifies an array of + * references to application security group. * @member {array} [loadBalancerBackendAddressPools] The load balancer * backend address pools. * @member {array} [loadBalancerInboundNatPools] The load balancer inbound @@ -126,6 +128,21 @@ class VirtualMachineScaleSetUpdateIPConfiguration extends models['SubResource'] } } }, + applicationSecurityGroups: { + required: false, + serializedName: 'properties.applicationSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, loadBalancerBackendAddressPools: { required: false, serializedName: 'properties.loadBalancerBackendAddressPools', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js index 9b4153b3ab..cddb45cbfe 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set network profile. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSDisk.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSDisk.js index 3ef0f2ea89..df462dd2c8 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSDisk.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSDisk.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes virtual machine scale set operating system disk Update Object. * This should be used for Updating VMSS OS Disk. @@ -24,6 +22,10 @@ class VirtualMachineScaleSetUpdateOSDisk { * 'None', 'ReadOnly', 'ReadWrite' * @member {boolean} [writeAcceleratorEnabled] Specifies whether * writeAccelerator should be enabled or disabled on the disk. + * @member {number} [diskSizeGB] Specifies the size of the operating system + * disk in gigabytes. This element can be used to overwrite the size of the + * disk in a virtual machine image.

This value cannot be larger than + * 1023 GB * @member {object} [image] The Source User Image VirtualHardDisk. This * VirtualHardDisk will be copied before using it to attach to the Virtual * Machine. If SourceImage is provided, the destination VirtualHardDisk @@ -33,8 +35,9 @@ class VirtualMachineScaleSetUpdateOSDisk { * uris. * @member {object} [managedDisk] The managed disk parameters. * @member {string} [managedDisk.storageAccountType] Specifies the storage - * account type for the managed disk. Possible values are: Standard_LRS or - * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * account type for the managed disk. NOTE: UltraSSD_LRS can only be used + * with data disks, it cannot be used with OS Disk. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' */ constructor() { } @@ -68,6 +71,13 @@ class VirtualMachineScaleSetUpdateOSDisk { name: 'Boolean' } }, + diskSizeGB: { + required: false, + serializedName: 'diskSizeGB', + type: { + name: 'Number' + } + }, image: { required: false, serializedName: 'image', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSProfile.js index 54fbf6cd9d..90c31f219f 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set OS profile. * @@ -46,6 +44,11 @@ class VirtualMachineScaleSetUpdateOSProfile { * configuration for a Linux OS. * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public * keys used to authenticate with linux based VMs. + * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine. + *

When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. * @member {array} [secrets] The List of certificates for addition to the VM. */ constructor() { diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js index 66c86376cc..840a0afbf0 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machines scale set IP Configuration's PublicIPAddress * configuration diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateStorageProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateStorageProfile.js index 4d51b93ded..f2cbc4aa8f 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateStorageProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateStorageProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set storage profile. * @@ -36,6 +34,10 @@ class VirtualMachineScaleSetUpdateStorageProfile { * include: 'None', 'ReadOnly', 'ReadWrite' * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether * writeAccelerator should be enabled or disabled on the disk. + * @member {number} [osDisk.diskSizeGB] Specifies the size of the operating + * system disk in gigabytes. This element can be used to overwrite the size + * of the disk in a virtual machine image.

This value cannot be + * larger than 1023 GB * @member {object} [osDisk.image] The Source User Image VirtualHardDisk. * This VirtualHardDisk will be copied before using it to attach to the * Virtual Machine. If SourceImage is provided, the destination @@ -45,9 +47,9 @@ class VirtualMachineScaleSetUpdateStorageProfile { * container uris. * @member {object} [osDisk.managedDisk] The managed disk parameters. * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the - * storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * storage account type for the managed disk. NOTE: UltraSSD_LRS can only be + * used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [dataDisks] The data disks. */ constructor() { diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateVMProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateVMProfile.js index 4f8962feef..6894c64882 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateVMProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateVMProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set virtual machine profile. * @@ -51,6 +49,12 @@ class VirtualMachineScaleSetUpdateVMProfile { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. * @member {array} [osProfile.secrets] The List of certificates for addition * to the VM. * @member {object} [storageProfile] The virtual machine scale set storage @@ -75,6 +79,10 @@ class VirtualMachineScaleSetUpdateVMProfile { * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] * Specifies whether writeAccelerator should be enabled or disabled on the * disk. + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * the operating system disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image.

This + * value cannot be larger than 1023 GB * @member {object} [storageProfile.osDisk.image] The Source User Image * VirtualHardDisk. This VirtualHardDisk will be copied before using it to * attach to the Virtual Machine. If SourceImage is provided, the destination @@ -86,9 +94,10 @@ class VirtualMachineScaleSetUpdateVMProfile { * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] The data disks. * @member {object} [networkProfile] The virtual machine scale set network * profile. @@ -98,9 +107,8 @@ class VirtualMachineScaleSetUpdateVMProfile { * diagnostics profile. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is * a debugging feature which allows you to view Console Output and Screenshot - * to diagnose VM status.

For Linux Virtual Machines, you can easily - * view the output of your console log.

For both Windows and Linux - * virtual machines, Azure also enables you to see a screenshot of the VM + * to diagnose VM status.

You can easily view the output of your + * console log.

Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether * boot diagnostics should be enabled on the Virtual Machine. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js index 7b9e19dea1..0c7b259f9a 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js @@ -32,16 +32,10 @@ class VirtualMachineScaleSetVM extends models['Resource'] { * has been applied to the virtual machine. * @member {string} [vmId] Azure VM unique ID. * @member {object} [instanceView] The virtual machine instance view. - * @member {number} [instanceView.platformUpdateDomain] Specifies the update - * domain of the virtual machine. - * @member {number} [instanceView.platformFaultDomain] Specifies the fault - * domain of the virtual machine. - * @member {string} [instanceView.computerName] The computer name assigned to - * the virtual machine. - * @member {string} [instanceView.osName] The Operating System running on the - * virtual machine. - * @member {string} [instanceView.osVersion] The version of Operating System - * running on the virtual machine. + * @member {number} [instanceView.platformUpdateDomain] The Update Domain + * count. + * @member {number} [instanceView.platformFaultDomain] The Fault Domain + * count. * @member {string} [instanceView.rdpThumbPrint] The Remote desktop * certificate thumbprint. * @member {object} [instanceView.vmAgent] The VM Agent running on the @@ -76,19 +70,45 @@ class VirtualMachineScaleSetVM extends models['Resource'] { * @member {string} * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message * returned for the last Maintenance Operation. - * @member {array} [instanceView.disks] The virtual machine disk information. + * @member {array} [instanceView.disks] The disks information. * @member {array} [instanceView.extensions] The extensions information. + * @member {object} [instanceView.vmHealth] The health status for the VM. + * @member {object} [instanceView.vmHealth.status] The health status + * information for the VM. + * @member {string} [instanceView.vmHealth.status.code] The status code. + * @member {string} [instanceView.vmHealth.status.level] The level code. + * Possible values include: 'Info', 'Warning', 'Error' + * @member {string} [instanceView.vmHealth.status.displayStatus] The short + * localizable label for the status. + * @member {string} [instanceView.vmHealth.status.message] The detailed + * status message, including for alerts and error messages. + * @member {date} [instanceView.vmHealth.status.time] The time of the status. * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot - * to diagnose VM status.

For Linux Virtual Machines, you can easily - * view the output of your console log.

For both Windows and Linux - * virtual machines, Azure also enables you to see a screenshot of the VM + * to diagnose VM status.

You can easily view the output of your + * console log.

Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] * The console screenshot blob URI. * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] * The Linux serial console log blob Uri. + * @member {object} [instanceView.bootDiagnostics.status] The boot + * diagnostics status information for the VM.

NOTE: It will be set + * only if there are errors encountered in enabling boot diagnostics. + * @member {string} [instanceView.bootDiagnostics.status.code] The status + * code. + * @member {string} [instanceView.bootDiagnostics.status.level] The level + * code. Possible values include: 'Info', 'Warning', 'Error' + * @member {string} [instanceView.bootDiagnostics.status.displayStatus] The + * short localizable label for the status. + * @member {string} [instanceView.bootDiagnostics.status.message] The + * detailed status message, including for alerts and error messages. + * @member {date} [instanceView.bootDiagnostics.status.time] The time of the + * status. * @member {array} [instanceView.statuses] The resource status information. + * @member {string} [instanceView.placementGroupId] The placement group in + * which the VM is running. If the VM is deallocated it will not have a + * placementGroupId. * @member {object} [hardwareProfile] Specifies the hardware settings for the * virtual machine. * @member {string} [hardwareProfile.vmSize] Specifies the size of the @@ -226,6 +246,12 @@ class VirtualMachineScaleSetVM extends models['Resource'] { * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] * Specifies whether writeAccelerator should be enabled or disabled on the * disk. + * @member {object} [storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the + * virtual machine. + * @member {string} [storageProfile.osDisk.diffDiskSettings.option] Specifies + * the differencing disk settings for operating system disk. Possible values + * include: 'Local' * @member {string} [storageProfile.osDisk.createOption] Specifies how the * virtual machine should be created.

Possible values are:

* **Attach** \u2013 This value is used when you are using a specialized disk @@ -237,18 +263,28 @@ class VirtualMachineScaleSetVM extends models['Resource'] { * 'Empty', 'Attach' * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of * an empty data disk in gigabytes. This element can be used to overwrite the - * name of the disk in a virtual machine image.

This value cannot be + * size of the disk in a virtual machine image.

This value cannot be * larger than 1023 GB * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that * are used to add a data disk to a virtual machine.

For more * information about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * @member {boolean} [additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks + * with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks + * with storage account type UltraSSD_LRS can be added to a virtual machine + * or virtual machine scale set only if this property is enabled. * @member {object} [osProfile] Specifies the operating system settings for * the virtual machine. * @member {string} [osProfile.computerName] Specifies the host OS name of @@ -327,8 +363,18 @@ class VirtualMachineScaleSetVM extends models['Resource'] { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machine. + * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether + * extension operations should be allowed on the virtual machine. + *

This may only be set to False when no extensions are present on + * the virtual machine. * @member {object} [networkProfile] Specifies the network interfaces of the * virtual machine. * @member {array} [networkProfile.networkInterfaces] Specifies the list of @@ -338,9 +384,8 @@ class VirtualMachineScaleSetVM extends models['Resource'] { * settings state.

Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is * a debugging feature which allows you to view Console Output and Screenshot - * to diagnose VM status.

For Linux Virtual Machines, you can easily - * view the output of your console log.

For both Windows and Linux - * virtual machines, Azure also enables you to see a screenshot of the VM + * to diagnose VM status.

You can easily view the output of your + * console log.

Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether * boot diagnostics should be enabled on the Virtual Machine. @@ -383,6 +428,7 @@ class VirtualMachineScaleSetVM extends models['Resource'] { * element. * @member {string} [plan.promotionCode] The promotion code. * @member {array} [resources] The virtual machine child extension resources. + * @member {array} [zones] The virtual machine zones. */ constructor() { super(); @@ -486,7 +532,7 @@ class VirtualMachineScaleSetVM extends models['Resource'] { serializedName: 'properties.instanceView', type: { name: 'Composite', - className: 'VirtualMachineInstanceView' + className: 'VirtualMachineScaleSetVMInstanceView' } }, hardwareProfile: { @@ -505,6 +551,14 @@ class VirtualMachineScaleSetVM extends models['Resource'] { className: 'StorageProfile' } }, + additionalCapabilities: { + required: false, + serializedName: 'properties.additionalCapabilities', + type: { + name: 'Composite', + className: 'AdditionalCapabilities' + } + }, osProfile: { required: false, serializedName: 'properties.osProfile', @@ -575,6 +629,21 @@ class VirtualMachineScaleSetVM extends models['Resource'] { } } } + }, + zones: { + required: false, + readOnly: true, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } } } } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js index ec86ebf39d..ddeedbc348 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Extensions summary for virtual machines of a virtual machine scale set. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js index e408d869b7..e786396ccb 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The instance view of a virtual machine scale set VM. * @@ -61,14 +59,24 @@ class VirtualMachineScaleSetVMInstanceView { * @member {date} [vmHealth.status.time] The time of the status. * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature * which allows you to view Console Output and Screenshot to diagnose VM - * status.

For Linux Virtual Machines, you can easily view the - * output of your console log.

For both Windows and Linux virtual - * machines, Azure also enables you to see a screenshot of the VM from the + * status.

You can easily view the output of your console log. + *

Azure also enables you to see a screenshot of the VM from the * hypervisor. * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console * screenshot blob URI. * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux * serial console log blob Uri. + * @member {object} [bootDiagnostics.status] The boot diagnostics status + * information for the VM.

NOTE: It will be set only if there are + * errors encountered in enabling boot diagnostics. + * @member {string} [bootDiagnostics.status.code] The status code. + * @member {string} [bootDiagnostics.status.level] The level code. Possible + * values include: 'Info', 'Warning', 'Error' + * @member {string} [bootDiagnostics.status.displayStatus] The short + * localizable label for the status. + * @member {string} [bootDiagnostics.status.message] The detailed status + * message, including for alerts and error messages. + * @member {date} [bootDiagnostics.status.time] The time of the status. * @member {array} [statuses] The resource status information. * @member {string} [placementGroupId] The placement group in which the VM is * running. If the VM is deallocated it will not have a placementGroupId. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js index 59d202754a..c03ebe43d0 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a virtual machine scale set virtual machine profile. * @@ -94,6 +92,12 @@ class VirtualMachineScaleSetVMProfile { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machines in the scale set. * @member {object} [storageProfile] Specifies the storage settings for the @@ -137,6 +141,16 @@ class VirtualMachineScaleSetVMProfile { * image, you also use the imageReference element described above. If you are * using a marketplace image, you also use the plan element previously * described. Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {object} [storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the + * virtual machine scale set. + * @member {string} [storageProfile.osDisk.diffDiskSettings.option] Specifies + * the differencing disk settings for operating system disk. Possible values + * include: 'Local' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * the operating system disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image.

This + * value cannot be larger than 1023 GB * @member {string} [storageProfile.osDisk.osType] This property allows you * to specify the type of the OS that is included in the disk if creating a * VM from user-image or a specialized VHD.

Possible values are: @@ -152,14 +166,24 @@ class VirtualMachineScaleSetVMProfile { * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that * are used to add data disks to the virtual machines in the scale set. *

For more information about disks, see [About disks and VHDs for * Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * @member {boolean} [additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks + * with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks + * with storage account type UltraSSD_LRS can be added to a virtual machine + * or virtual machine scale set only if this property is enabled. * @member {object} [networkProfile] Specifies properties of the network * interfaces of the virtual machines in the scale set. * @member {object} [networkProfile.healthProbe] A reference to a load @@ -175,9 +199,8 @@ class VirtualMachineScaleSetVMProfile { * settings state.

Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is * a debugging feature which allows you to view Console Output and Screenshot - * to diagnose VM status.

For Linux Virtual Machines, you can easily - * view the output of your console log.

For both Windows and Linux - * virtual machines, Azure also enables you to see a screenshot of the VM + * to diagnose VM status.

You can easily view the output of your + * console log.

Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether * boot diagnostics should be enabled on the Virtual Machine. @@ -199,6 +222,9 @@ class VirtualMachineScaleSetVMProfile { * @member {string} [priority] Specifies the priority for the virtual * machines in the scale set.

Minimum api-version: * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * @member {string} [evictionPolicy] Specifies the eviction policy for + * virtual machines in a low priority scale set.

Minimum api-version: + * 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' */ constructor() { } @@ -233,6 +259,14 @@ class VirtualMachineScaleSetVMProfile { className: 'VirtualMachineScaleSetStorageProfile' } }, + additionalCapabilities: { + required: false, + serializedName: 'additionalCapabilities', + type: { + name: 'Composite', + className: 'AdditionalCapabilities' + } + }, networkProfile: { required: false, serializedName: 'networkProfile', @@ -270,6 +304,13 @@ class VirtualMachineScaleSetVMProfile { type: { name: 'String' } + }, + evictionPolicy: { + required: false, + serializedName: 'evictionPolicy', + type: { + name: 'String' + } } } } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js b/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js index bfc6f87c21..0bc64c4604 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * Describes a Virtual Machine. + * Describes a Virtual Machine Update. * * @extends models['UpdateResource'] */ @@ -170,6 +170,12 @@ class VirtualMachineUpdate extends models['UpdateResource'] { * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] * Specifies whether writeAccelerator should be enabled or disabled on the * disk. + * @member {object} [storageProfile.osDisk.diffDiskSettings] Specifies the + * differencing Disk Settings for the operating system disk used by the + * virtual machine. + * @member {string} [storageProfile.osDisk.diffDiskSettings.option] Specifies + * the differencing disk settings for operating system disk. Possible values + * include: 'Local' * @member {string} [storageProfile.osDisk.createOption] Specifies how the * virtual machine should be created.

Possible values are:

* **Attach** \u2013 This value is used when you are using a specialized disk @@ -181,18 +187,26 @@ class VirtualMachineUpdate extends models['UpdateResource'] { * 'Empty', 'Attach' * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of * an empty data disk in gigabytes. This element can be used to overwrite the - * name of the disk in a virtual machine image.

This value cannot be + * size of the disk in a virtual machine image.

This value cannot be * larger than 1023 GB * @member {object} [storageProfile.osDisk.managedDisk] The managed disk * parameters. * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'StandardSSD_LRS', 'UltraSSD_LRS' * @member {array} [storageProfile.dataDisks] Specifies the parameters that * are used to add a data disk to a virtual machine.

For more * information about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * @member {boolean} [additionalCapabilities.ultraSSDEnabled] The flag that + * enables or disables a capability to have one or more managed data disks + * with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks + * with storage account type UltraSSD_LRS can be added to a virtual machine + * or virtual machine scale set only if this property is enabled. * @member {object} [osProfile] Specifies the operating system settings for * the virtual machine. * @member {string} [osProfile.computerName] Specifies the host OS name of @@ -271,8 +285,18 @@ class VirtualMachineUpdate extends models['UpdateResource'] { * configuration for a Linux OS. * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of * SSH public keys used to authenticate with linux based VMs. + * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. * @member {array} [osProfile.secrets] Specifies set of certificates that * should be installed onto the virtual machine. + * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether + * extension operations should be allowed on the virtual machine. + *

This may only be set to False when no extensions are present on + * the virtual machine. * @member {object} [networkProfile] Specifies the network interfaces of the * virtual machine. * @member {array} [networkProfile.networkInterfaces] Specifies the list of @@ -282,9 +306,8 @@ class VirtualMachineUpdate extends models['UpdateResource'] { * settings state.

Minimum api-version: 2015-06-15. * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is * a debugging feature which allows you to view Console Output and Screenshot - * to diagnose VM status.

For Linux Virtual Machines, you can easily - * view the output of your console log.

For both Windows and Linux - * virtual machines, Azure also enables you to see a screenshot of the VM + * to diagnose VM status.

You can easily view the output of your + * console log.

Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether * boot diagnostics should be enabled on the Virtual Machine. @@ -353,14 +376,26 @@ class VirtualMachineUpdate extends models['UpdateResource'] { * @member {array} [instanceView.extensions] The extensions information. * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a * debugging feature which allows you to view Console Output and Screenshot - * to diagnose VM status.

For Linux Virtual Machines, you can easily - * view the output of your console log.

For both Windows and Linux - * virtual machines, Azure also enables you to see a screenshot of the VM + * to diagnose VM status.

You can easily view the output of your + * console log.

Azure also enables you to see a screenshot of the VM * from the hypervisor. * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] * The console screenshot blob URI. * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] * The Linux serial console log blob Uri. + * @member {object} [instanceView.bootDiagnostics.status] The boot + * diagnostics status information for the VM.

NOTE: It will be set + * only if there are errors encountered in enabling boot diagnostics. + * @member {string} [instanceView.bootDiagnostics.status.code] The status + * code. + * @member {string} [instanceView.bootDiagnostics.status.level] The level + * code. Possible values include: 'Info', 'Warning', 'Error' + * @member {string} [instanceView.bootDiagnostics.status.displayStatus] The + * short localizable label for the status. + * @member {string} [instanceView.bootDiagnostics.status.message] The + * detailed status message, including for alerts and error messages. + * @member {date} [instanceView.bootDiagnostics.status.time] The time of the + * status. * @member {array} [instanceView.statuses] The resource status information. * @member {string} [licenseType] Specifies that the image or disk that is * being used was licensed on-premises. This element is only used for images @@ -388,10 +423,10 @@ class VirtualMachineUpdate extends models['UpdateResource'] { * type 'None' will remove any identities from the virtual machine. Possible * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, * UserAssigned', 'None' - * @member {array} [identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * @member {array} [zones] The virtual machine zones. */ constructor() { @@ -450,6 +485,14 @@ class VirtualMachineUpdate extends models['UpdateResource'] { className: 'StorageProfile' } }, + additionalCapabilities: { + required: false, + serializedName: 'properties.additionalCapabilities', + type: { + name: 'Composite', + className: 'AdditionalCapabilities' + } + }, osProfile: { required: false, serializedName: 'properties.osProfile', diff --git a/lib/services/computeManagement2/lib/models/winRMConfiguration.js b/lib/services/computeManagement2/lib/models/winRMConfiguration.js index 0ce512bfb7..a3f2d1ba8d 100644 --- a/lib/services/computeManagement2/lib/models/winRMConfiguration.js +++ b/lib/services/computeManagement2/lib/models/winRMConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes Windows Remote Management configuration of the VM * diff --git a/lib/services/computeManagement2/lib/models/windowsConfiguration.js b/lib/services/computeManagement2/lib/models/windowsConfiguration.js index c3cf889c8d..5d2cb0544a 100644 --- a/lib/services/computeManagement2/lib/models/windowsConfiguration.js +++ b/lib/services/computeManagement2/lib/models/windowsConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Specifies Windows operating system settings on the virtual machine. * diff --git a/lib/services/computeManagement2/lib/operations/availabilitySets.js b/lib/services/computeManagement2/lib/operations/availabilitySets.js index 292da5c63a..9c19cadd17 100644 --- a/lib/services/computeManagement2/lib/operations/availabilitySets.js +++ b/lib/services/computeManagement2/lib/operations/availabilitySets.js @@ -31,7 +31,10 @@ const WebResource = msRest.WebResource; * @param {array} [parameters.virtualMachines] A list of references to all * virtual machines in the availability set. * - * @param {object} [parameters.sku] Sku of the availability set + * @param {object} [parameters.sku] Sku of the availability set, only name is + * required to be set. See AvailabilitySetSkuTypes for possible set of values. + * Use 'Aligned' for virtual machines with managed disks and 'Classic' for + * virtual machines with unmanaged disks. Default value is 'Classic'. * * @param {string} [parameters.sku.name] The sku name. * @@ -74,7 +77,7 @@ function _createOrUpdate(resourceGroupName, availabilitySetName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -257,7 +260,7 @@ function _update(resourceGroupName, availabilitySetName, parameters, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -400,9 +403,7 @@ function _update(resourceGroupName, availabilitySetName, parameters, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -418,7 +419,7 @@ function _deleteMethod(resourceGroupName, availabilitySetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -504,23 +505,6 @@ function _deleteMethod(resourceGroupName, availabilitySetName, options, callback // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -561,7 +545,7 @@ function _get(resourceGroupName, availabilitySetName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -669,6 +653,138 @@ function _get(resourceGroupName, availabilitySetName, options, callback) { }); } +/** + * Lists all availability sets 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 AvailabilitySetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBySubscription(options, callback) { + /* jshint 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 apiVersion = '2018-10-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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.Compute/availabilitySets'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AvailabilitySetListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * Lists all availability sets in a resource group. * @@ -703,7 +819,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -844,7 +960,7 @@ function _listAvailableSizes(resourceGroupName, availabilitySetName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -952,80 +1068,282 @@ function _listAvailableSizes(resourceGroupName, availabilitySetName, options, ca }); } -/** Class representing a AvailabilitySets. */ -class AvailabilitySets { - /** - * Create a AvailabilitySets. - * @param {ComputeManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._list = _list; - this._listAvailableSizes = _listAvailableSizes; +/** + * Lists all availability sets 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 AvailabilitySetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBySubscriptionNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; } - - /** - * Create or update an availability set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} availabilitySetName The name of the availability set. - * - * @param {object} parameters Parameters supplied to the Create Availability - * Set operation. - * - * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. - * - * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. - * - * @param {array} [parameters.virtualMachines] A list of references to all - * virtual machines in the availability set. - * - * @param {object} [parameters.sku] Sku of the availability set - * - * @param {string} [parameters.sku.name] The sku name. - * - * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines - * in a scale set.

Possible Values:

**Standard**

**Basic** - * - * @param {number} [parameters.sku.capacity] Specifies the number of virtual - * machines in the scale set. - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.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, availabilitySetName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, availabilitySetName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); } - /** + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AvailabilitySetListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all availability sets 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 AvailabilitySetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AvailabilitySetListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 AvailabilitySets. */ +class AvailabilitySets { + /** + * Create a AvailabilitySets. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._listBySubscription = _listBySubscription; + this._list = _list; + this._listAvailableSizes = _listAvailableSizes; + this._listBySubscriptionNext = _listBySubscriptionNext; + this._listNext = _listNext; + } + + /** * Create or update an availability set. * * @param {string} resourceGroupName The name of the resource group. @@ -1042,7 +1360,70 @@ class AvailabilitySets { * @param {array} [parameters.virtualMachines] A list of references to all * virtual machines in the availability set. * - * @param {object} [parameters.sku] Sku of the availability set + * @param {object} [parameters.sku] Sku of the availability set, only name is + * required to be set. See AvailabilitySetSkuTypes for possible set of values. + * Use 'Aligned' for virtual machines with managed disks and 'Classic' for + * virtual machines with unmanaged disks. Default value is 'Classic'. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

Possible Values:

**Standard**

**Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.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, availabilitySetName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, availabilitySetName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Create Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set, only name is + * required to be set. See AvailabilitySetSkuTypes for possible set of values. + * Use 'Aligned' for virtual machines with managed disks and 'Classic' for + * virtual machines with unmanaged disks. Default value is 'Classic'. * * @param {string} [parameters.sku.name] The sku name. * @@ -1250,7 +1631,7 @@ class AvailabilitySets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1287,7 +1668,7 @@ class AvailabilitySets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1295,9 +1676,7 @@ class AvailabilitySets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1409,6 +1788,85 @@ class AvailabilitySets { } } + /** + * Lists all availability sets 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. + */ + listBySubscriptionWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySubscription(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all availability sets 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 {AvailabilitySetListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscription(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBySubscription(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySubscription(options, optionalCallback); + } + } + /** * Lists all availability sets in a resource group. * @@ -1581,6 +2039,176 @@ class AvailabilitySets { } } + /** + * Lists all availability sets 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. + */ + listBySubscriptionNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all availability sets 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 {AvailabilitySetListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscriptionNext(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._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySubscriptionNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all availability sets 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. + */ + 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; + }); + }); + } + + /** + * Lists all availability sets 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 {AvailabilitySetListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySetListResult} for more + * information. + * + * {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 = AvailabilitySets; diff --git a/lib/services/computeManagement2/lib/operations/disks.js b/lib/services/computeManagement2/lib/operations/disks.js index aeb9e01a49..d6f0e0ed24 100644 --- a/lib/services/computeManagement2/lib/operations/disks.js +++ b/lib/services/computeManagement2/lib/operations/disks.js @@ -31,7 +31,7 @@ const WebResource = msRest.WebResource; * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [disk.zones] The Logical zone list for Disk. * @@ -53,7 +53,7 @@ const WebResource = msRest.WebResource; * @param {object} [disk.creationData.imageReference] Disk source information. * * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [disk.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -101,6 +101,14 @@ const WebResource = msRest.WebResource; * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {string} disk.location Resource location * * @param {object} [disk.tags] Resource tags @@ -228,12 +236,20 @@ function _createOrUpdate(resourceGroupName, diskName, disk, options, callback) { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {object} [disk.tags] Resource tags * * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {object} [options] Optional Parameters. * @@ -343,7 +359,7 @@ function _get(resourceGroupName, diskName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -473,9 +489,7 @@ function _get(resourceGroupName, diskName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -513,20 +527,6 @@ function _deleteMethod(resourceGroupName, diskName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -566,7 +566,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -701,7 +701,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -913,9 +913,7 @@ function _grantAccess(resourceGroupName, diskName, grantAccessData, options, cal * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -953,20 +951,6 @@ function _revokeAccess(resourceGroupName, diskName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -989,7 +973,7 @@ function _revokeAccess(resourceGroupName, diskName, options, callback) { * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [disk.zones] The Logical zone list for Disk. * @@ -1011,7 +995,7 @@ function _revokeAccess(resourceGroupName, diskName, options, callback) { * @param {object} [disk.creationData.imageReference] Disk source information. * * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [disk.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -1059,6 +1043,14 @@ function _revokeAccess(resourceGroupName, diskName, options, callback) { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {string} disk.location Resource location * * @param {object} [disk.tags] Resource tags @@ -1091,7 +1083,7 @@ function _beginCreateOrUpdate(resourceGroupName, diskName, disk, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1285,12 +1277,20 @@ function _beginCreateOrUpdate(resourceGroupName, diskName, disk, options, callba * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {object} [disk.tags] Resource tags * * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {object} [options] Optional Parameters. * @@ -1320,7 +1320,7 @@ function _beginUpdate(resourceGroupName, diskName, disk, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1483,9 +1483,7 @@ function _beginUpdate(resourceGroupName, diskName, disk, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1501,7 +1499,7 @@ function _beginDeleteMethod(resourceGroupName, diskName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1587,23 +1585,6 @@ function _beginDeleteMethod(resourceGroupName, diskName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -1656,7 +1637,7 @@ function _beginGrantAccess(resourceGroupName, diskName, grantAccessData, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1802,9 +1783,7 @@ function _beginGrantAccess(resourceGroupName, diskName, grantAccessData, options * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1820,7 +1799,7 @@ function _beginRevokeAccess(resourceGroupName, diskName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1906,23 +1885,6 @@ function _beginRevokeAccess(resourceGroupName, diskName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -2223,7 +2185,7 @@ class Disks { * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [disk.zones] The Logical zone list for Disk. * @@ -2245,7 +2207,7 @@ class Disks { * @param {object} [disk.creationData.imageReference] Disk source information. * * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [disk.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -2293,6 +2255,14 @@ class Disks { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {string} disk.location Resource location * * @param {object} [disk.tags] Resource tags @@ -2338,7 +2308,7 @@ class Disks { * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [disk.zones] The Logical zone list for Disk. * @@ -2360,7 +2330,7 @@ class Disks { * @param {object} [disk.creationData.imageReference] Disk source information. * * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [disk.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -2408,6 +2378,14 @@ class Disks { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {string} disk.location Resource location * * @param {object} [disk.tags] Resource tags @@ -2511,12 +2489,20 @@ class Disks { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {object} [disk.tags] Resource tags * * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {object} [options] Optional Parameters. * @@ -2595,12 +2581,20 @@ class Disks { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {object} [disk.tags] Resource tags * * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {object} [options] Optional Parameters. * @@ -2758,7 +2752,7 @@ class Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2798,7 +2792,7 @@ class Disks { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2806,9 +2800,7 @@ class Disks { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3121,7 +3113,7 @@ class Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3161,7 +3153,7 @@ class Disks { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3169,9 +3161,7 @@ class Disks { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3213,7 +3203,7 @@ class Disks { * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [disk.zones] The Logical zone list for Disk. * @@ -3235,7 +3225,7 @@ class Disks { * @param {object} [disk.creationData.imageReference] Disk source information. * * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [disk.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -3283,6 +3273,14 @@ class Disks { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {string} disk.location Resource location * * @param {object} [disk.tags] Resource tags @@ -3328,7 +3326,7 @@ class Disks { * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [disk.zones] The Logical zone list for Disk. * @@ -3350,7 +3348,7 @@ class Disks { * @param {object} [disk.creationData.imageReference] Disk source information. * * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [disk.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -3398,6 +3396,14 @@ class Disks { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {string} disk.location Resource location * * @param {object} [disk.tags] Resource tags @@ -3501,12 +3507,20 @@ class Disks { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {object} [disk.tags] Resource tags * * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {object} [options] Optional Parameters. * @@ -3585,12 +3599,20 @@ class Disks { * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing * to a key or secret in KeyVault * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * * @param {object} [disk.tags] Resource tags * * @param {object} [disk.sku] * * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {object} [options] Optional Parameters. * @@ -3656,7 +3678,7 @@ class Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3696,7 +3718,7 @@ class Disks { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3704,9 +3726,7 @@ class Disks { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3859,7 +3879,7 @@ class Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3899,7 +3919,7 @@ class Disks { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3907,9 +3927,7 @@ class Disks { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/computeManagement2/lib/operations/galleries.js b/lib/services/computeManagement2/lib/operations/galleries.js new file mode 100644 index 0000000000..f06a95e924 --- /dev/null +++ b/lib/services/computeManagement2/lib/operations/galleries.js @@ -0,0 +1,2009 @@ +/* + * 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; + + +/** + * Create or update a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. + * + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. + * + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. + * + * @param {object} [gallery.identifier] + * + * @param {string} gallery.location Resource location + * + * @param {object} [gallery.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 Gallery} for more information. + * + * {object} [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, galleryName, gallery, options, callback) { + /* jshint 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, galleryName, gallery, 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['Gallery']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Retrieves information about a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Gallery} for more information. + * + * {object} [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, galleryName, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Gallery']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Delete a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, galleryName, options, callback) { + /* jshint 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, galleryName, 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); + }); + }); +} + +/** + * List galleries under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. + * + * {object} [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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List galleries under 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 GalleryList} for more information. + * + * {object} [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 apiVersion = '2018-06-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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.Compute/galleries'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Create or update a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. + * + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. + * + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. + * + * @param {object} [gallery.identifier] + * + * @param {string} gallery.location Resource location + * + * @param {object} [gallery.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 Gallery} for more information. + * + * {object} [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, galleryName, gallery, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (gallery === null || gallery === undefined) { + throw new Error('gallery cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (gallery !== null && gallery !== undefined) { + let requestModelMapper = new client.models['Gallery']().mapper(); + requestModel = client.serialize(requestModelMapper, gallery, 'gallery'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(gallery, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Gallery']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['Gallery']().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['Gallery']().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); + }); +} + +/** + * Delete a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, galleryName, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List galleries under 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 GalleryList} for more information. + * + * {object} [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) { + 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['GalleryList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List galleries under 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 GalleryList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Galleries. */ +class Galleries { + /** + * Create a Galleries. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Create or update a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. + * + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. + * + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. + * + * @param {object} [gallery.identifier] + * + * @param {string} gallery.location Resource location + * + * @param {object} [gallery.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, galleryName, gallery, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, galleryName, gallery, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. + * + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. + * + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. + * + * @param {object} [gallery.identifier] + * + * @param {string} gallery.location Resource location + * + * @param {object} [gallery.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 {Gallery} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Gallery} for more information. + * + * {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, galleryName, gallery, options, optionalCallback) { + 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, galleryName, gallery, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, galleryName, gallery, options, optionalCallback); + } + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, galleryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, galleryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Gallery} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Gallery} for more information. + * + * {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, galleryName, options, optionalCallback) { + 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, galleryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, galleryName, options, optionalCallback); + } + } + + /** + * Delete a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, galleryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, galleryName, options, optionalCallback) { + 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, galleryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, galleryName, options, optionalCallback); + } + } + + /** + * List galleries under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * List galleries under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {GalleryList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. + * + * {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); + } + } + + /** + * List galleries under 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; + }); + }); + } + + /** + * List galleries under 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 {GalleryList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. + * + * {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); + } + } + + /** + * Create or update a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. + * + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. + * + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. + * + * @param {object} [gallery.identifier] + * + * @param {string} gallery.location Resource location + * + * @param {object} [gallery.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, galleryName, gallery, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. + * + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. + * + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. + * + * @param {object} [gallery.identifier] + * + * @param {string} gallery.location Resource location + * + * @param {object} [gallery.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 {Gallery} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Gallery} for more information. + * + * {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, galleryName, gallery, options, optionalCallback) { + 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, galleryName, gallery, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options, optionalCallback); + } + } + + /** + * Delete a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, galleryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, galleryName, options, optionalCallback) { + 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, galleryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, galleryName, options, optionalCallback); + } + } + + /** + * List galleries under 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; + }); + }); + } + + /** + * List galleries under 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 {GalleryList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. + * + * {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); + } + } + + /** + * List galleries under 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; + }); + }); + } + + /** + * List galleries under 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 {GalleryList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. + * + * {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 = Galleries; diff --git a/lib/services/computeManagement2/lib/operations/galleryImageVersions.js b/lib/services/computeManagement2/lib/operations/galleryImageVersions.js new file mode 100644 index 0000000000..d38aff799c --- /dev/null +++ b/lib/services/computeManagement2/lib/operations/galleryImageVersions.js @@ -0,0 +1,1882 @@ +/* + * 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; + + +/** + * Create or update a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. + * + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. + * + * @param {object} galleryImageVersion.publishingProfile + * + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. + * + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. + * + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. + * + * @param {object} galleryImageVersion.publishingProfile.source + * + * @param {object} galleryImageVersion.publishingProfile.source.managedImage + * + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. + * + * @param {string} galleryImageVersion.location Resource location + * + * @param {object} [galleryImageVersion.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 GalleryImageVersion} for more information. + * + * {object} [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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, callback) { + /* jshint 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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, 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['GalleryImageVersion']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Retrieves information about a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'ReplicationStatus' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersion} for more information. + * + * {object} [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, galleryName, galleryImageName, galleryImageVersionName, options, callback) { + /* jshint 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') { + throw new Error('galleryImageName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') { + throw new Error('galleryImageVersionName cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName)); + requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName)); + let queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryImageVersion']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Delete a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, galleryName, galleryImageName, galleryImageVersionName, options, callback) { + /* jshint 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, galleryName, galleryImageName, galleryImageVersionName, 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); + }); + }); +} + +/** + * List gallery Image Versions in a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the Shared Image Gallery Image + * Definition from which the Image Versions are to be listed. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') { + throw new Error('galleryImageName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryImageVersionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Create or update a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. + * + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. + * + * @param {object} galleryImageVersion.publishingProfile + * + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. + * + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. + * + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. + * + * @param {object} galleryImageVersion.publishingProfile.source + * + * @param {object} galleryImageVersion.publishingProfile.source.managedImage + * + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. + * + * @param {string} galleryImageVersion.location Resource location + * + * @param {object} [galleryImageVersion.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 GalleryImageVersion} for more information. + * + * {object} [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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') { + throw new Error('galleryImageName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') { + throw new Error('galleryImageVersionName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageVersion === null || galleryImageVersion === undefined) { + throw new Error('galleryImageVersion cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName)); + requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (galleryImageVersion !== null && galleryImageVersion !== undefined) { + let requestModelMapper = new client.models['GalleryImageVersion']().mapper(); + requestModel = client.serialize(requestModelMapper, galleryImageVersion, 'galleryImageVersion'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(galleryImageVersion, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryImageVersion']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['GalleryImageVersion']().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['GalleryImageVersion']().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); + }); +} + +/** + * Delete a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, galleryName, galleryImageName, galleryImageVersionName, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') { + throw new Error('galleryImageName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') { + throw new Error('galleryImageVersionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName)); + requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List gallery Image Versions in a gallery Image Definition. + * + * @param {string} nextPageLink The NextLink from the previous 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 GalleryImageVersionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByGalleryImageNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryImageVersionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 GalleryImageVersions. */ +class GalleryImageVersions { + /** + * Create a GalleryImageVersions. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByGalleryImage = _listByGalleryImage; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByGalleryImageNext = _listByGalleryImageNext; + } + + /** + * Create or update a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. + * + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. + * + * @param {object} galleryImageVersion.publishingProfile + * + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. + * + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. + * + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. + * + * @param {object} galleryImageVersion.publishingProfile.source + * + * @param {object} galleryImageVersion.publishingProfile.source.managedImage + * + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. + * + * @param {string} galleryImageVersion.location Resource location + * + * @param {object} [galleryImageVersion.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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. + * + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. + * + * @param {object} galleryImageVersion.publishingProfile + * + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. + * + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. + * + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. + * + * @param {object} galleryImageVersion.publishingProfile.source + * + * @param {object} galleryImageVersion.publishingProfile.source.managedImage + * + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. + * + * @param {string} galleryImageVersion.location Resource location + * + * @param {object} [galleryImageVersion.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 {GalleryImageVersion} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersion} for more information. + * + * {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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, optionalCallback) { + 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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, optionalCallback); + } + } + + /** + * Retrieves information about a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'ReplicationStatus' + * + * @param {object} [options.customHeaders] Headers 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, galleryName, galleryImageName, galleryImageVersionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves information about a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'ReplicationStatus' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {GalleryImageVersion} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersion} for more information. + * + * {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, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback) { + 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, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback); + } + } + + /** + * Delete a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, galleryName, galleryImageName, galleryImageVersionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback) { + 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, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback); + } + } + + /** + * List gallery Image Versions in a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the Shared Image Gallery Image + * Definition from which the Image Versions are to be listed. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByGalleryImageWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List gallery Image Versions in a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the Shared Image Gallery Image + * Definition from which the Image Versions are to be listed. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {GalleryImageVersionList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, optionalCallback); + } + } + + /** + * Create or update a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. + * + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. + * + * @param {object} galleryImageVersion.publishingProfile + * + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. + * + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. + * + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. + * + * @param {object} galleryImageVersion.publishingProfile.source + * + * @param {object} galleryImageVersion.publishingProfile.source.managedImage + * + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. + * + * @param {string} galleryImageVersion.location Resource location + * + * @param {object} [galleryImageVersion.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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. + * + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. + * + * @param {object} galleryImageVersion.publishingProfile + * + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. + * + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. + * + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. + * + * @param {object} galleryImageVersion.publishingProfile.source + * + * @param {object} galleryImageVersion.publishingProfile.source.managedImage + * + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. + * + * @param {string} galleryImageVersion.location Resource location + * + * @param {object} [galleryImageVersion.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 {GalleryImageVersion} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersion} for more information. + * + * {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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, optionalCallback) { + 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, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, optionalCallback); + } + } + + /** + * Delete a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, galleryName, galleryImageName, galleryImageVersionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete a gallery Image Version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback) { + 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, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback); + } + } + + /** + * List gallery Image Versions in a gallery Image Definition. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByGalleryImageNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByGalleryImageNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List gallery Image Versions in a gallery Image Definition. + * + * @param {string} nextPageLink The NextLink from the previous 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 {GalleryImageVersionList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByGalleryImageNext(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._listByGalleryImageNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByGalleryImageNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = GalleryImageVersions; diff --git a/lib/services/computeManagement2/lib/operations/galleryImages.js b/lib/services/computeManagement2/lib/operations/galleryImages.js new file mode 100644 index 0000000000..2fe4846efb --- /dev/null +++ b/lib/services/computeManagement2/lib/operations/galleryImages.js @@ -0,0 +1,1984 @@ +/* + * 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; + + +/** + * Create or update a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. + * + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. + * + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. + * + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. + * + * @param {string} [galleryImage.releaseNoteUri] The release note uri. + * + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' + * + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. + * + * @param {object} galleryImage.identifier + * + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. + * + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. + * + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. + * + * @param {object} [galleryImage.recommended] + * + * @param {object} [galleryImage.recommended.vCPUs] + * + * @param {object} [galleryImage.recommended.memory] + * + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. + * + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. + * + * @param {object} [galleryImage.disallowed] + * + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] + * + * @param {string} [galleryImage.purchasePlan.name] The plan ID. + * + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. + * + * @param {string} [galleryImage.purchasePlan.product] The product ID. + * + * @param {string} galleryImage.location Resource location + * + * @param {object} [galleryImage.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 GalleryImage} for more information. + * + * {object} [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, galleryName, galleryImageName, galleryImage, options, callback) { + /* jshint 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, galleryName, galleryImageName, galleryImage, 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['GalleryImage']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Retrieves information about a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery from which + * the Image Definitions are to be retrieved. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImage} for more information. + * + * {object} [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, galleryName, galleryImageName, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') { + throw new Error('galleryImageName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryImage']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Delete a gallery image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, galleryName, galleryImageName, options, callback) { + /* jshint 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, galleryName, galleryImageName, 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); + }); + }); +} + +/** + * List gallery Image Definitions in a gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery from which + * Image Definitions are to be listed. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByGallery(resourceGroupName, galleryName, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryImageList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Create or update a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. + * + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. + * + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. + * + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. + * + * @param {string} [galleryImage.releaseNoteUri] The release note uri. + * + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' + * + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. + * + * @param {object} galleryImage.identifier + * + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. + * + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. + * + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. + * + * @param {object} [galleryImage.recommended] + * + * @param {object} [galleryImage.recommended.vCPUs] + * + * @param {object} [galleryImage.recommended.memory] + * + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. + * + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. + * + * @param {object} [galleryImage.disallowed] + * + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] + * + * @param {string} [galleryImage.purchasePlan.name] The plan ID. + * + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. + * + * @param {string} [galleryImage.purchasePlan.product] The product ID. + * + * @param {string} galleryImage.location Resource location + * + * @param {object} [galleryImage.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 GalleryImage} for more information. + * + * {object} [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, galleryName, galleryImageName, galleryImage, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') { + throw new Error('galleryImageName cannot be null or undefined and it must be of type string.'); + } + if (galleryImage === null || galleryImage === undefined) { + throw new Error('galleryImage cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (galleryImage !== null && galleryImage !== undefined) { + let requestModelMapper = new client.models['GalleryImage']().mapper(); + requestModel = client.serialize(requestModelMapper, galleryImage, 'galleryImage'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(galleryImage, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryImage']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['GalleryImage']().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['GalleryImage']().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); + }); +} + +/** + * Delete a gallery image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, galleryName, galleryImageName, options, callback) { + /* jshint 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 apiVersion = '2018-06-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') { + throw new Error('galleryName cannot be null or undefined and it must be of type string.'); + } + if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') { + throw new Error('galleryImageName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName)); + requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List gallery Image Definitions in a gallery. + * + * @param {string} nextPageLink The NextLink from the previous 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 GalleryImageList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByGalleryNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GalleryImageList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 GalleryImages. */ +class GalleryImages { + /** + * Create a GalleryImages. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByGallery = _listByGallery; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByGalleryNext = _listByGalleryNext; + } + + /** + * Create or update a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. + * + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. + * + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. + * + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. + * + * @param {string} [galleryImage.releaseNoteUri] The release note uri. + * + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' + * + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. + * + * @param {object} galleryImage.identifier + * + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. + * + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. + * + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. + * + * @param {object} [galleryImage.recommended] + * + * @param {object} [galleryImage.recommended.vCPUs] + * + * @param {object} [galleryImage.recommended.memory] + * + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. + * + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. + * + * @param {object} [galleryImage.disallowed] + * + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] + * + * @param {string} [galleryImage.purchasePlan.name] The plan ID. + * + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. + * + * @param {string} [galleryImage.purchasePlan.product] The product ID. + * + * @param {string} galleryImage.location Resource location + * + * @param {object} [galleryImage.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, galleryName, galleryImageName, galleryImage, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. + * + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. + * + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. + * + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. + * + * @param {string} [galleryImage.releaseNoteUri] The release note uri. + * + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' + * + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. + * + * @param {object} galleryImage.identifier + * + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. + * + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. + * + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. + * + * @param {object} [galleryImage.recommended] + * + * @param {object} [galleryImage.recommended.vCPUs] + * + * @param {object} [galleryImage.recommended.memory] + * + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. + * + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. + * + * @param {object} [galleryImage.disallowed] + * + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] + * + * @param {string} [galleryImage.purchasePlan.name] The plan ID. + * + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. + * + * @param {string} [galleryImage.purchasePlan.product] The product ID. + * + * @param {string} galleryImage.location Resource location + * + * @param {object} [galleryImage.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 {GalleryImage} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImage} for more information. + * + * {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, galleryName, galleryImageName, galleryImage, options, optionalCallback) { + 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, galleryName, galleryImageName, galleryImage, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, optionalCallback); + } + } + + /** + * Retrieves information about a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery from which + * the Image Definitions are to be retrieved. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, galleryName, galleryImageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves information about a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery from which + * the Image Definitions are to be retrieved. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {GalleryImage} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImage} for more information. + * + * {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, galleryName, galleryImageName, options, optionalCallback) { + 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, galleryName, galleryImageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, galleryName, galleryImageName, options, optionalCallback); + } + } + + /** + * Delete a gallery image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, galleryName, galleryImageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete a gallery image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, galleryName, galleryImageName, options, optionalCallback) { + 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, galleryName, galleryImageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback); + } + } + + /** + * List gallery Image Definitions in a gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery from which + * Image Definitions are to be listed. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByGalleryWithHttpOperationResponse(resourceGroupName, galleryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByGallery(resourceGroupName, galleryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List gallery Image Definitions in a gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery from which + * Image Definitions are to be listed. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {GalleryImageList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByGallery(resourceGroupName, galleryName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByGallery(resourceGroupName, galleryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByGallery(resourceGroupName, galleryName, options, optionalCallback); + } + } + + /** + * Create or update a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. + * + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. + * + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. + * + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. + * + * @param {string} [galleryImage.releaseNoteUri] The release note uri. + * + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' + * + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. + * + * @param {object} galleryImage.identifier + * + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. + * + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. + * + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. + * + * @param {object} [galleryImage.recommended] + * + * @param {object} [galleryImage.recommended.vCPUs] + * + * @param {object} [galleryImage.recommended.memory] + * + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. + * + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. + * + * @param {object} [galleryImage.disallowed] + * + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] + * + * @param {string} [galleryImage.purchasePlan.name] The plan ID. + * + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. + * + * @param {string} [galleryImage.purchasePlan.product] The product ID. + * + * @param {string} galleryImage.location Resource location + * + * @param {object} [galleryImage.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, galleryName, galleryImageName, galleryImage, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. + * + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. + * + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. + * + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. + * + * @param {string} [galleryImage.releaseNoteUri] The release note uri. + * + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' + * + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. + * + * @param {object} galleryImage.identifier + * + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. + * + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. + * + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. + * + * @param {object} [galleryImage.recommended] + * + * @param {object} [galleryImage.recommended.vCPUs] + * + * @param {object} [galleryImage.recommended.memory] + * + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. + * + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. + * + * @param {object} [galleryImage.disallowed] + * + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] + * + * @param {string} [galleryImage.purchasePlan.name] The plan ID. + * + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. + * + * @param {string} [galleryImage.purchasePlan.product] The product ID. + * + * @param {string} galleryImage.location Resource location + * + * @param {object} [galleryImage.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 {GalleryImage} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImage} for more information. + * + * {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, galleryName, galleryImageName, galleryImage, options, optionalCallback) { + 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, galleryName, galleryImageName, galleryImage, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, optionalCallback); + } + } + + /** + * Delete a gallery image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, galleryName, galleryImageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete a gallery image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, galleryName, galleryImageName, options, optionalCallback) { + 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, galleryName, galleryImageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback); + } + } + + /** + * List gallery Image Definitions in a gallery. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByGalleryNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByGalleryNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List gallery Image Definitions in a gallery. + * + * @param {string} nextPageLink The NextLink from the previous 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 {GalleryImageList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByGalleryNext(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._listByGalleryNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByGalleryNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = GalleryImages; diff --git a/lib/services/computeManagement2/lib/operations/images.js b/lib/services/computeManagement2/lib/operations/images.js index 27ee1a0181..332562714c 100644 --- a/lib/services/computeManagement2/lib/operations/images.js +++ b/lib/services/computeManagement2/lib/operations/images.js @@ -67,9 +67,9 @@ const WebResource = msRest.WebResource; * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -208,9 +208,9 @@ function _createOrUpdate(resourceGroupName, imageName, parameters, options, call * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -313,9 +313,7 @@ function _update(resourceGroupName, imageName, parameters, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -353,20 +351,6 @@ function _deleteMethod(resourceGroupName, imageName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -412,7 +396,7 @@ function _get(resourceGroupName, imageName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -559,7 +543,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -696,7 +680,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -848,9 +832,9 @@ function _list(options, callback) { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -894,7 +878,7 @@ function _beginCreateOrUpdate(resourceGroupName, imageName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1088,9 +1072,9 @@ function _beginCreateOrUpdate(resourceGroupName, imageName, parameters, options, * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -1132,7 +1116,7 @@ function _beginUpdate(resourceGroupName, imageName, parameters, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1292,9 +1276,7 @@ function _beginUpdate(resourceGroupName, imageName, parameters, options, callbac * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1310,7 +1292,7 @@ function _beginDeleteMethod(resourceGroupName, imageName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1396,23 +1378,6 @@ function _beginDeleteMethod(resourceGroupName, imageName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -1747,9 +1712,9 @@ class Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -1842,9 +1807,9 @@ class Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -1959,9 +1924,9 @@ class Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -2052,9 +2017,9 @@ class Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -2129,7 +2094,7 @@ class Images { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2166,7 +2131,7 @@ class Images { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2174,9 +2139,7 @@ class Images { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2510,9 +2473,9 @@ class Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -2605,9 +2568,9 @@ class Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -2722,9 +2685,9 @@ class Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -2815,9 +2778,9 @@ class Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

@@ -2892,7 +2855,7 @@ class Images { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2929,7 +2892,7 @@ class Images { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2937,9 +2900,7 @@ class Images { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/computeManagement2/lib/operations/index.d.ts b/lib/services/computeManagement2/lib/operations/index.d.ts index e625011837..7b86697aab 100644 --- a/lib/services/computeManagement2/lib/operations/index.d.ts +++ b/lib/services/computeManagement2/lib/operations/index.d.ts @@ -99,7 +99,10 @@ export interface AvailabilitySets { * @param {array} [parameters.virtualMachines] A list of references to all * virtual machines in the availability set. * - * @param {object} [parameters.sku] Sku of the availability set + * @param {object} [parameters.sku] Sku of the availability set, only name is + * required to be set. See AvailabilitySetSkuTypes for possible set of values. + * Use 'Aligned' for virtual machines with managed disks and 'Classic' for + * virtual machines with unmanaged disks. Default value is 'Classic'. * * @param {string} [parameters.sku.name] The sku name. * @@ -144,7 +147,10 @@ export interface AvailabilitySets { * @param {array} [parameters.virtualMachines] A list of references to all * virtual machines in the availability set. * - * @param {object} [parameters.sku] Sku of the availability set + * @param {object} [parameters.sku] Sku of the availability set, only name is + * required to be set. See AvailabilitySetSkuTypes for possible set of values. + * Use 'Aligned' for virtual machines with managed disks and 'Classic' for + * virtual machines with unmanaged disks. Default value is 'Classic'. * * @param {string} [parameters.sku.name] The sku name. * @@ -310,11 +316,11 @@ export interface AvailabilitySets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete an availability set. @@ -335,7 +341,7 @@ export interface AvailabilitySets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -343,17 +349,15 @@ export interface AvailabilitySets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -415,6 +419,58 @@ export interface AvailabilitySets { get(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Lists all availability sets 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. + */ + listBySubscriptionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all availability sets 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 {AvailabilitySetListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {AvailabilitySetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySetListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscription(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscription(callback: ServiceCallback): void; + listBySubscription(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Lists all availability sets in a resource group. * @@ -531,6 +587,122 @@ export interface AvailabilitySets { listAvailableSizes(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; listAvailableSizes(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void; listAvailableSizes(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all availability sets 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. + */ + listBySubscriptionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all availability sets 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 {AvailabilitySetListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {AvailabilitySetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySetListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscriptionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscriptionNext(nextPageLink: string, callback: ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all availability sets 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. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all availability sets 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 {AvailabilitySetListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {AvailabilitySetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySetListResult} for more + * information. + * + * {WebResource} [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; } /** @@ -1060,11 +1232,11 @@ export interface VirtualMachineExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to delete the extension. @@ -1088,7 +1260,7 @@ export interface VirtualMachineExtensions { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1096,17 +1268,15 @@ export interface VirtualMachineExtensions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1181,6 +1351,74 @@ export interface VirtualMachineExtensions { get(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that 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(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineExtensionsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualMachineExtensionsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtensionsListResult} for more + * information. + * + * {WebResource} [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(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * The operation to create or update the extension. * @@ -1490,11 +1728,11 @@ export interface VirtualMachineExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to delete the extension. @@ -1518,7 +1756,7 @@ export interface VirtualMachineExtensions { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1526,64 +1764,66 @@ export interface VirtualMachineExtensions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * VirtualMachines + * VirtualMachineImages * __NOTE__: An instance of this class is automatically created for an * instance of the ComputeManagementClient. */ -export interface VirtualMachines { +export interface VirtualMachineImages { /** - * The operation to get all extensions of a Virtual Machine. + * Gets a virtual machine image. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} location The name of a supported Azure region. * - * @param {string} vmName The name of the virtual machine containing the - * extension. + * @param {string} publisherName A valid image publisher. * - * @param {object} [options] Optional Parameters. + * @param {string} offer A valid image publisher offer. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. + * @param {string} skus A valid image SKU. + * + * @param {string} version A valid image SKU version. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getExtensionsWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to get all extensions of a Virtual Machine. + * Gets a virtual machine image. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} location The name of a supported Azure region. * - * @param {string} vmName The name of the virtual machine containing the - * extension. + * @param {string} publisherName A valid image publisher. * - * @param {object} [options] Optional Parameters. + * @param {string} offer A valid image publisher offer. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. + * @param {string} skus A valid image SKU. + * + * @param {string} version A valid image SKU version. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1595,7 +1835,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineExtensionsListResult} - The deserialized result object. + * @resolve {VirtualMachineImage} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1603,73 +1843,68 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineExtensionsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineExtensionsListResult} for more - * information. + * {VirtualMachineImage} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineImage} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getExtensions(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getExtensions(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - getExtensions(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(location: string, publisherName: string, offer: string, skus: string, version: string, callback: ServiceCallback): void; + get(location: string, publisherName: string, offer: string, skus: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Captures the VM by copying virtual hard disks of the VM and outputs a - * template that can be used to create similar VMs. + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} location The name of a supported Azure region. * - * @param {string} vmName The name of the virtual machine. + * @param {string} publisherName A valid image publisher. * - * @param {object} parameters Parameters supplied to the Capture Virtual - * Machine operation. + * @param {string} offer A valid image publisher offer. * - * @param {string} parameters.vhdPrefix The captured virtual hard disk's name - * prefix. + * @param {string} skus A valid image SKU. * - * @param {string} parameters.destinationContainerName The destination - * container name. + * @param {object} [options] Optional Parameters. * - * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the - * destination virtual hard disk, in case of conflict. + * @param {string} [options.filter] The filter to apply on the operation. * - * @param {object} [options] Optional Parameters. + * @param {number} [options.top] + * + * @param {string} [options.orderby] * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - captureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Captures the VM by copying virtual hard disks of the VM and outputs a - * template that can be used to create similar VMs. + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} location The name of a supported Azure region. * - * @param {string} vmName The name of the virtual machine. + * @param {string} publisherName A valid image publisher. * - * @param {object} parameters Parameters supplied to the Capture Virtual - * Machine operation. + * @param {string} offer A valid image publisher offer. * - * @param {string} parameters.vhdPrefix The captured virtual hard disk's name - * prefix. + * @param {string} skus A valid image SKU. * - * @param {string} parameters.destinationContainerName The destination - * container name. + * @param {object} [options] Optional Parameters. * - * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the - * destination virtual hard disk, in case of conflict. + * @param {string} [options.filter] The filter to apply on the operation. * - * @param {object} [options] Optional Parameters. + * @param {number} [options.top] + * + * @param {string} [options.orderby] * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1681,7 +1916,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineCaptureResult} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1689,403 +1924,272 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineCaptureResult} for more - * information. + * {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. */ - capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; - capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, publisherName: string, offer: string, skus: string, callback: ServiceCallback): void; + list(location: string, publisherName: string, offer: string, skus: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to create or update a virtual machine. + * Gets a list of virtual machine image offers for the specified location and + * publisher. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} location The name of a supported Azure region. * - * @param {string} vmName The name of the virtual machine. + * @param {string} publisherName A valid image publisher. * - * @param {object} parameters Parameters supplied to the Create Virtual Machine - * operation. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.plan] Specifies information about the - * marketplace image used to create the virtual machine. This element is only - * used for marketplace images. Before you can use a marketplace image from an - * API, you must enable the image for programmatic use. In the Azure portal, - * find the marketplace image that you want to use and then click **Want to - * deploy programmatically, Get Started ->**. Enter any required information - * and then click **Save**. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.plan.name] The plan ID. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.plan.publisher] The publisher ID. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. + * @reject {Error|ServiceError} - The error object. + */ + listOffersWithHttpOperationResponse(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image offers for the specified location and + * publisher. * - * @param {string} [parameters.plan.promotionCode] The promotion code. + * @param {string} location The name of a supported Azure region. * - * @param {object} [parameters.hardwareProfile] Specifies the hardware settings - * for the virtual machine. + * @param {string} publisherName A valid image publisher. * - * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of - * the virtual machine. For more information about virtual machine sizes, see - * [Sizes for virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

The available VM sizes depend on region and availability set. For a - * list of available sizes use these APIs:

[List all available - * virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) - *

[List all available virtual machine sizes in a - * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) - *

[List all available virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', - * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', - * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', - * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', - * 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', - * 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', - * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', - * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', - * 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', - * 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', - * 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', - * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', - * 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', - * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', - * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', - * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', - * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', - * 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - * 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', - * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', - * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', - * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', - * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', - * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', - * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', - * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', - * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', - * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', - * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', - * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', - * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', - * 'Standard_NV12', 'Standard_NV24' + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile.imageReference] Specifies - * information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element - * is required when you want to use a platform image, marketplace image, or - * virtual machine image, but is not used in other creation operations. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.storageProfile.imageReference.publisher] The - * image publisher. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.storageProfile.imageReference.offer] Specifies - * the offer of the platform image or marketplace image used to create the - * virtual machine. + * {Promise} A promise is returned. * - * @param {string} [parameters.storageProfile.imageReference.sku] The image - * SKU. + * @resolve {Array} - The deserialized result object. * - * @param {string} [parameters.storageProfile.imageReference.version] Specifies - * the version of the platform image or marketplace image used to create the - * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the - * latest version of an image available at deploy time. Even if you use - * 'latest', the VM image will not automatically update after deploy time even - * if a new version becomes available. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.storageProfile.osDisk.osType] This property - * allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD.

Possible values - * are:

**Windows**

**Linux**. Possible values include: - * 'Windows', 'Linux' + * {Array} [result] - The deserialized result object if an error did not occur. * - * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] - * Specifies the encryption settings for the OS Disk.

Minimum - * api-version: 2015-06-15 + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] - * Specifies the location of the disk encryption key, which is a Key Vault - * Secret. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listOffers(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOffers(location: string, publisherName: string, callback: ServiceCallback): void; + listOffers(location: string, publisherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine image publishers for the specified Azure + * location. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl - * The URL referencing a secret in a Key Vault. + * @param {string} location The name of a supported Azure region. * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the secret. + * @param {object} [options] Optional Parameters. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] - * Specifies the location of the key encryption key in Key Vault. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl - * The URL referencing a key encryption key in Key Vault. + * @returns {Promise} A promise is returned * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the key. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} - * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies - * whether disk encryption should be enabled on the virtual machine. + * @reject {Error|ServiceError} - The error object. + */ + listPublishersWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image publishers for the specified Azure + * location. * - * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * @param {string} location The name of a supported Azure region. * - * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard - * disk. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.storageProfile.osDisk.image] The source user - * image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination - * virtual hard drive must not exist. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the - * virtual hard disk's uri. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

Possible values are:

**None** - *

**ReadOnly**

**ReadWrite**

Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. + * {Promise} A promise is returned. * - * @param {string} parameters.storageProfile.osDisk.createOption Specifies how - * the virtual machine should be created.

Possible values are:

- * **Attach** \u2013 This value is used when you are using a specialized disk - * to create the virtual machine.

**FromImage** \u2013 This value is - * used when you are using an image to create the virtual machine. If you are - * using a platform image, you also use the imageReference element described - * above. If you are using a marketplace image, you also use the plan element - * previously described. Possible values include: 'FromImage', 'Empty', - * 'Attach' + * @resolve {Array} - The deserialized result object. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

This - * value cannot be larger than 1023 GB + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed - * disk parameters. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} - * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * {Array} [result] - The deserialized result object if an error did not occur. * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

- * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.osProfile] Specifies the operating system - * settings for the virtual machine. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPublishers(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishers(location: string, callback: ServiceCallback): void; + listPublishers(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. * - * @param {string} [parameters.osProfile.computerName] Specifies the host OS - * name of the virtual machine.

**Max-length (Windows):** 15 - * characters

**Max-length (Linux):** 64 characters.

For - * naming conventions and restrictions see [Azure infrastructure services - * implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @param {string} location The name of a supported Azure region. * - * @param {string} [parameters.osProfile.adminUsername] Specifies the name of - * the administrator account.

**Windows-only restriction:** Cannot end - * in "."

**Disallowed values:** "administrator", "admin", "user", - * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", - * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - * "john", "owner", "root", "server", "sql", "support", "support_388945a0", - * "sys", "test2", "test3", "user4", "user5".

**Minimum-length - * (Linux):** 1 character

**Max-length (Linux):** 64 characters - *

**Max-length (Windows):** 20 characters

  • For root - * access to the Linux VM, see [Using root privileges on Linux virtual machines - * in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in this - * field, see [Selecting User Names for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @param {string} publisherName A valid image publisher. * - * @param {string} [parameters.osProfile.adminPassword] Specifies the password - * of the administrator account.

    **Minimum-length (Windows):** 8 - * characters

    **Minimum-length (Linux):** 6 characters

    - * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 - * characters

    **Complexity requirements:** 3 out of 4 conditions below - * need to be fulfilled
    Has lower characters
    Has upper characters
    - * Has a digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!"

    For resetting the password, see [How to reset the - * Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    For resetting root password, see [Manage users, SSH, and check or - * repair disks on Azure Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @param {string} offer A valid image publisher offer. * - * @param {string} [parameters.osProfile.customData] Specifies a base-64 - * encoded string of custom data. The base-64 encoded string is decoded to a - * binary array that is saved as a file on the Virtual Machine. The maximum - * length of the binary array is 65535 bytes.

    For using cloud-init for - * your VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.osProfile.windowsConfiguration] Specifies - * Windows operating system settings on the virtual machine. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates - * whether virtual machine agent should be provisioned on the virtual machine. - *

    When this property is not specified in the request body, default - * behavior is to set it to true. This will ensure that VM Agent is installed - * on the VM so that extensions can be added to the VM later. + * @returns {Promise} A promise is returned * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates - * whether virtual machine is enabled for automatic updates. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] - * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @reject {Error|ServiceError} - The error object. + */ + listSkusWithHttpOperationResponse(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] - * Specifies additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file, which is used by Windows Setup. + * @param {string} location The name of a supported Azure region. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies - * the Windows Remote Management listeners. This enables remote Windows - * PowerShell. + * @param {string} publisherName A valid image publisher. * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * The list of Windows Remote Management listeners + * @param {string} offer A valid image publisher offer. * - * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the - * Linux operating system settings on the virtual machine.

    For a list - * of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @param {object} [options] Optional Parameters. * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * Specifies whether password authentication should be disabled. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the - * ssh key configuration for a Linux OS. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The - * list of SSH public keys used to authenticate with linux based VMs. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} [parameters.osProfile.secrets] Specifies set of certificates - * that should be installed onto the virtual machine. + * {Promise} A promise is returned. * - * @param {object} [parameters.networkProfile] Specifies the network interfaces - * of the virtual machine. + * @resolve {Array} - The deserialized result object. * - * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the - * list of resource Ids for the network interfaces associated with the virtual - * machine. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.diagnosticsProfile] Specifies the boot - * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot - * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a - * screenshot of the VM from the hypervisor. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * Whether boot diagnostics should be enabled on the Virtual Machine. + * {Array} [result] - The deserialized result object if an error did not occur. * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * Uri of the storage account to use for placing the console output and - * screenshot. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.availabilitySet] Specifies information about the - * availability set that the virtual machine should be assigned to. Virtual - * machines specified in the same availability set are allocated to different - * nodes to maximize availability. For more information about availability - * sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSkus(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkus(location: string, publisherName: string, offer: string, callback: ServiceCallback): void; + listSkus(location: string, publisherName: string, offer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * UsageOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface UsageOperations { + + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. * - * @param {string} [parameters.availabilitySet.id] Resource Id + * @param {string} location The location for which resource usage is queried. * - * @param {string} [parameters.licenseType] Specifies that the image or disk - * that is being used was licensed on-premises. This element is only used for - * images that contain the Windows Server operating system.

    Possible - * values are:

    Windows_Client

    Windows_Server

    If this - * element is included in a request for an update, the value must match the - * initial value. This value cannot be updated.

    For more information, - * see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Minimum api-version: 2015-06-15 + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.identity] The identity of the virtual machine, - * if configured. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.identity.type] The type of identity used for the - * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' + * @returns {Promise} A promise is returned * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.zones] The virtual machine zones. + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. * - * @param {string} parameters.location Resource location + * @param {string} location The location for which resource usage is queried. * - * @param {object} [parameters.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 {ListUsagesResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListUsagesResult} for more information. + * + * {WebResource} [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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2094,11 +2198,206 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under 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 {ListUsagesResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListUsagesResult} for more information. + * + * {WebResource} [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 + * VirtualMachines + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachines { + + + /** + * Gets all the virtual machines under the specified subscription for the + * specified location. + * + * @param {string} location The location for which virtual machines under the + * subscription are queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByLocationWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the virtual machines under the specified subscription for the + * specified location. + * + * @param {string} location The location for which virtual machines under the + * subscription are queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(location: string, callback: ServiceCallback): void; + listByLocation(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + captureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineCaptureResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineCaptureResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** * The operation to create or update a virtual machine. @@ -2284,6 +2583,14 @@ export interface VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -2296,7 +2603,7 @@ export interface VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -2304,9 +2611,9 @@ export interface VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -2317,6 +2624,15 @@ export interface VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -2413,10 +2729,21 @@ export interface VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * - * @param {object} [parameters.networkProfile] Specifies the network interfaces + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the @@ -2428,9 +2755,8 @@ export interface VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -2474,10 +2800,10 @@ export interface VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -2490,41 +2816,22 @@ export interface VirtualMachines { * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {VirtualMachine} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {VirtualMachine} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachine} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to update a virtual machine. + * The operation to create or update a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Update Virtual Machine + * @param {object} parameters Parameters supplied to the Create Virtual Machine * operation. * * @param {object} [parameters.plan] Specifies information about the @@ -2701,6 +3008,14 @@ export interface VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -2713,7 +3028,7 @@ export interface VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -2721,9 +3036,9 @@ export interface VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -2734,6 +3049,15 @@ export interface VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -2830,9 +3154,20 @@ export interface VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -2845,9 +3180,8 @@ export interface VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -2891,13 +3225,15 @@ export interface VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * + * @param {string} parameters.location Resource location + * * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. @@ -2905,13 +3241,32 @@ export interface VirtualMachines { * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {Promise} A promise is returned. + * + * @resolve {VirtualMachine} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** * The operation to update a virtual machine. @@ -3097,6 +3452,14 @@ export interface VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -3109,7 +3472,7 @@ export interface VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -3117,9 +3480,9 @@ export interface VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -3130,6 +3493,15 @@ export interface VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -3226,9 +3598,20 @@ export interface VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -3241,9 +3624,8 @@ export interface VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -3287,10 +3669,10 @@ export interface VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -3301,248 +3683,423 @@ export interface VirtualMachines { * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {VirtualMachine} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {VirtualMachine} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachine} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + updateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to delete a virtual machine. + * The operation to update a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.plan.name] The plan ID. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.plan.publisher] The publisher ID. * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The operation to delete a virtual machine. + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.plan.promotionCode] The promotion code. * - * @param {string} vmName The name of the virtual machine. + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', + * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', + * 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', + * 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', + * 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', + * 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', + * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', + * 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', + * 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. * - * {Promise} A promise is returned. + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves information about the model view or the instance view of a virtual - * machine. + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] The expand expression to apply on the - * operation. Possible values include: 'instanceView' + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. * - * @returns {Promise} A promise is returned + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves information about the model view or the instance view of a virtual - * machine. + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. * - * @param {string} resourceGroupName The name of the resource group. + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. * - * @param {string} vmName The name of the virtual machine. + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. Possible values include: 'instanceView' + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. * - * {Promise} A promise is returned. + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. * - * @resolve {VirtualMachine} - The deserialized result object. + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' * - * @reject {Error|ServiceError} - The error object. + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. * - * {VirtualMachine} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachine} for more information. + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves information about the run-time state of a virtual machine. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. * - * @param {string} vmName The name of the virtual machine. + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). * - * @returns {Promise} A promise is returned + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) * - * @reject {Error|ServiceError} - The error object. - */ - instanceViewWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves information about the run-time state of a virtual machine. + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. * - * @param {string} vmName The name of the virtual machine. + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * - * @param {object} [options] Optional Parameters. + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. * - * {Promise} A promise is returned. + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners * - * @resolve {VirtualMachineInstanceView} - The deserialized result object. + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * - * @reject {Error|ServiceError} - The error object. + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. * - * {VirtualMachineInstanceView} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineInstanceView} for more - * information. + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - instanceView(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - instanceView(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - instanceView(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual - * machine must be stop-deallocated before invoking this operation. + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. * - * @param {string} vmName The name of the virtual machine. + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a + * screenshot of the VM from the hypervisor. * - * @returns {Promise} A promise is returned + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. * - * @reject {Error|ServiceError} - The error object. - */ - convertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual - * machine must be stop-deallocated before invoking this operation. + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.availabilitySet.id] Resource Id * - * @param {string} vmName The name of the virtual machine. + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -3556,7 +4113,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {VirtualMachine} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3564,22 +4121,20 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - convertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - convertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - convertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Shuts down the virtual machine and releases the compute resources. You are - * not billed for the compute resources that this virtual machine uses. + * The operation to delete a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -3592,15 +4147,14 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Shuts down the virtual machine and releases the compute resources. You are - * not billed for the compute resources that this virtual machine uses. + * The operation to delete a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -3618,7 +4172,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3626,21 +4180,20 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - deallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - deallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Sets the state of the virtual machine to generalized. + * Retrieves information about the model view or the instance view of a virtual + * machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -3648,19 +4201,23 @@ export interface VirtualMachines { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - generalizeWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets the state of the virtual machine to generalized. + * Retrieves information about the model view or the instance view of a virtual + * machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -3668,6 +4225,9 @@ export interface VirtualMachines { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3678,7 +4238,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {VirtualMachine} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3686,25 +4246,25 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - generalize(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generalize(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - generalize(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the virtual machines in the specified resource group. Use the - * nextLink property in the response to get the next page of virtual machines. + * Retrieves information about the run-time state of a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} vmName The name of the virtual machine. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3712,18 +4272,19 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + instanceViewWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the virtual machines in the specified resource group. Use the - * nextLink property in the response to get the next page of virtual machines. + * Retrieves information about the run-time state of a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} vmName The name of the virtual machine. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3736,7 +4297,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineListResult} - The deserialized result object. + * @resolve {VirtualMachineInstanceView} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3744,22 +4305,26 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineListResult} for more + * {VirtualMachineInstanceView} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineInstanceView} for more * information. * * {WebResource} [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(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + instanceView(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + instanceView(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + instanceView(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the virtual machines in the specified subscription. Use the - * nextLink property in the response to get the next page of virtual machines. + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -3768,15 +4333,19 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + convertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the virtual machines in the specified subscription. Use the - * nextLink property in the response to get the next page of virtual machines. + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -3790,7 +4359,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3798,22 +4367,20 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineListResult} for more - * information. + * {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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + convertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + convertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + convertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all available virtual machine sizes to which the specified virtual - * machine can be resized. + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. * * @param {string} resourceGroupName The name of the resource group. * @@ -3826,15 +4393,15 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAvailableSizesWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all available virtual machine sizes to which the specified virtual - * machine can be resized. + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. * * @param {string} resourceGroupName The name of the resource group. * @@ -3852,7 +4419,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineSizeListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3860,23 +4427,19 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineSizeListResult} for more - * information. + * {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. */ - listAvailableSizes(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableSizes(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - listAvailableSizes(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to power off (stop) a virtual machine. The virtual machine can - * be restarted with the same provisioned resources. You are still charged for - * this virtual machine. + * Sets the state of the virtual machine to generalized. * * @param {string} resourceGroupName The name of the resource group. * @@ -3889,16 +4452,14 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - powerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + generalizeWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to power off (stop) a virtual machine. The virtual machine can - * be restarted with the same provisioned resources. You are still charged for - * this virtual machine. + * Sets the state of the virtual machine to generalized. * * @param {string} resourceGroupName The name of the resource group. * @@ -3916,7 +4477,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3924,26 +4485,23 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - powerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + generalize(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generalize(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + generalize(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to restart a virtual machine. + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3951,19 +4509,18 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - restartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to restart a virtual machine. + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3976,7 +4533,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {VirtualMachineListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3984,25 +4541,22 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more * information. * * {WebResource} [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, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - restart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to start a virtual machine. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. * * @param {object} [options] Optional Parameters. * @@ -4011,18 +4565,15 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to start a virtual machine. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. * * @param {object} [options] Optional Parameters. * @@ -4036,7 +4587,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {VirtualMachineListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4044,21 +4595,22 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more * information. * * {WebResource} [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, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to redeploy a virtual machine. + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. * * @param {string} resourceGroupName The name of the resource group. * @@ -4071,14 +4623,15 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - redeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAvailableSizesWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to redeploy a virtual machine. + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. * * @param {string} resourceGroupName The name of the resource group. * @@ -4096,7 +4649,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {VirtualMachineSizeListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4104,21 +4657,23 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more + * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineSizeListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - redeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAvailableSizes(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSizes(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + listAvailableSizes(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to perform maintenance on a virtual machine. + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -4131,14 +4686,16 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + powerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to perform maintenance on a virtual machine. + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -4156,7 +4713,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4164,36 +4721,24 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - performMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - performMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - performMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Run command on the VM. + * The operation to restart a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Run command operation. - * - * @param {string} parameters.commandId The run command id. - * - * @param {array} [parameters.script] Optional. The script to be executed. - * When this value is given, the given script will override the default script - * of the command. - * - * @param {array} [parameters.parameters] The run command parameters. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4201,29 +4746,271 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - runCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Run command on the VM. + * The operation to restart a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Run command operation. - * - * @param {string} parameters.commandId The run command id. - * - * @param {array} [parameters.script] Optional. The script to be executed. - * When this value is given, the given script will override the default script - * of the command. - * - * @param {array} [parameters.parameters] The run command parameters. - * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + redeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + redeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + performMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + performMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + runCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4526,6 +5313,14 @@ export interface VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -4538,7 +5333,7 @@ export interface VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -4546,9 +5341,9 @@ export interface VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -4559,6 +5354,15 @@ export interface VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -4655,9 +5459,20 @@ export interface VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -4670,9 +5485,8 @@ export interface VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -4716,10 +5530,10 @@ export interface VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -4924,6 +5738,14 @@ export interface VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -4936,7 +5758,7 @@ export interface VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -4944,9 +5766,9 @@ export interface VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -4957,6 +5779,15 @@ export interface VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -5053,10 +5884,21 @@ export interface VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * - * @param {array} [parameters.osProfile.secrets] Specifies set of certificates - * that should be installed onto the virtual machine. - * - * @param {object} [parameters.networkProfile] Specifies the network interfaces + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the @@ -5068,9 +5910,8 @@ export interface VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -5114,10 +5955,10 @@ export interface VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -5341,6 +6182,14 @@ export interface VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -5353,7 +6202,7 @@ export interface VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -5361,9 +6210,9 @@ export interface VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -5374,6 +6223,15 @@ export interface VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -5470,9 +6328,20 @@ export interface VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -5485,9 +6354,8 @@ export interface VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -5531,10 +6399,10 @@ export interface VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -5737,6 +6605,14 @@ export interface VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -5749,7 +6625,7 @@ export interface VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -5757,9 +6633,9 @@ export interface VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -5770,6 +6646,15 @@ export interface VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -5866,9 +6751,20 @@ export interface VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -5881,9 +6777,8 @@ export interface VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -5927,10 +6822,10 @@ export interface VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -5982,11 +6877,11 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to delete a virtual machine. @@ -6007,7 +6902,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6015,17 +6910,15 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6043,11 +6936,11 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginConvertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginConvertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Converts virtual machine disks from blob-based to managed disks. Virtual @@ -6069,7 +6962,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6077,17 +6970,15 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginConvertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6105,11 +6996,11 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Shuts down the virtual machine and releases the compute resources. You are @@ -6131,7 +7022,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6139,17 +7030,15 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginDeallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginDeallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6168,11 +7057,11 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to power off (stop) a virtual machine. The virtual machine can @@ -6195,7 +7084,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6203,17 +7092,15 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginPowerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6230,11 +7117,11 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRestartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to restart a virtual machine. @@ -6255,7 +7142,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6263,17 +7150,15 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginRestart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6290,11 +7175,11 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to start a virtual machine. @@ -6315,7 +7200,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6323,17 +7208,15 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginStart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6350,11 +7233,11 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to redeploy a virtual machine. @@ -6375,7 +7258,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6383,17 +7266,15 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginRedeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRedeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginRedeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRedeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6410,11 +7291,11 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to perform maintenance on a virtual machine. @@ -6435,7 +7316,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6443,17 +7324,15 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginPerformMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPerformMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginPerformMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPerformMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6536,8 +7415,8 @@ export interface VirtualMachines { /** - * Lists all of the virtual machines in the specified resource group. Use the - * nextLink property in the response to get the next page of virtual machines. + * Gets all the virtual machines under the specified subscription for the + * specified location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6553,11 +7432,11 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the virtual machines in the specified resource group. Use the - * nextLink property in the response to get the next page of virtual machines. + * Gets all the virtual machines under the specified subscription for the + * specified location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6590,13 +7469,13 @@ export interface VirtualMachines { * * {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; + listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the virtual machines in the specified subscription. Use the + * Lists all of the virtual machines in the specified resource group. Use the * nextLink property in the response to get the next page of virtual machines. * * @param {string} nextPageLink The NextLink from the previous successful call @@ -6613,10 +7492,10 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the virtual machines in the specified subscription. Use the + * Lists all of the virtual machines in the specified resource group. Use the * nextLink property in the response to get the next page of virtual machines. * * @param {string} nextPageLink The NextLink from the previous successful call @@ -6650,32 +7529,17 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualMachineImages - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface VirtualMachineImages { + 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; /** - * Gets a virtual machine image. - * - * @param {string} location The name of a supported Azure region. - * - * @param {string} publisherName A valid image publisher. - * - * @param {string} offer A valid image publisher offer. - * - * @param {string} skus A valid image SKU. + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. * - * @param {string} version A valid image SKU version. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6684,24 +7548,18 @@ export interface VirtualMachineImages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a virtual machine image. - * - * @param {string} location The name of a supported Azure region. - * - * @param {string} publisherName A valid image publisher. - * - * @param {string} offer A valid image publisher offer. - * - * @param {string} skus A valid image SKU. + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. * - * @param {string} version A valid image SKU version. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6715,7 +7573,7 @@ export interface VirtualMachineImages { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineImage} - The deserialized result object. + * @resolve {VirtualMachineListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6723,69 +7581,57 @@ export interface VirtualMachineImages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineImage} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineImage} for more information. + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. * * {WebResource} [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(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(location: string, publisherName: string, offer: string, skus: string, version: string, callback: ServiceCallback): void; - get(location: string, publisherName: string, offer: string, skus: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineSizes + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineSizes { /** - * Gets a list of all virtual machine image versions for the specified - * location, publisher, offer, and SKU. - * - * @param {string} location The name of a supported Azure region. + * This API is deprecated. Use [Resources + * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) * - * @param {string} publisherName A valid image publisher. - * - * @param {string} offer A valid image publisher offer. - * - * @param {string} skus A valid image SKU. + * @param {string} location The location upon which virtual-machine-sizes is + * queried. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {number} [options.top] - * - * @param {string} [options.orderby] - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of all virtual machine image versions for the specified - * location, publisher, offer, and SKU. - * - * @param {string} location The name of a supported Azure region. - * - * @param {string} publisherName A valid image publisher. - * - * @param {string} offer A valid image publisher offer. + * This API is deprecated. Use [Resources + * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) * - * @param {string} skus A valid image SKU. + * @param {string} location The location upon which virtual-machine-sizes is + * queried. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {number} [options.top] - * - * @param {string} [options.orderby] - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -6796,7 +7642,7 @@ export interface VirtualMachineImages { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {VirtualMachineSizeListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6804,82 +7650,97 @@ export interface VirtualMachineImages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineSizeListResult} for more + * information. * * {WebResource} [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(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, publisherName: string, offer: string, skus: string, callback: ServiceCallback): void; - list(location: string, publisherName: string, offer: string, skus: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Images + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Images { /** - * Gets a list of virtual machine image offers for the specified location and - * publisher. + * Create or update an image. * - * @param {string} location The name of a supported Azure region. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publisherName A valid image publisher. + * @param {string} imageName The name of the image. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters Parameters supplied to the Create Image + * operation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * @returns {Promise} A promise is returned + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @reject {Error|ServiceError} - The error object. - */ - listOffersWithHttpOperationResponse(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of virtual machine image offers for the specified location and - * publisher. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {string} location The name of a supported Azure region. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @param {string} publisherName A valid image publisher. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * @returns {ServiceCallback|Promise} 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. + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * - * {Array} [result] - The deserialized result object if an error did not occur. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listOffers(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listOffers(location: string, publisherName: string, callback: ServiceCallback): void; - listOffers(location: string, publisherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a list of virtual machine image publishers for the specified Azure - * location. + * @param {string} parameters.location Resource location * - * @param {string} location The name of a supported Azure region. + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -6888,81 +7749,81 @@ export interface VirtualMachineImages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listPublishersWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual machine image publishers for the specified Azure - * location. - * - * @param {string} location The name of a supported Azure region. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * Create or update an image. * - * {Promise} A promise is returned. + * @param {string} resourceGroupName The name of the resource group. * - * @resolve {Array} - The deserialized result object. + * @param {string} imageName The name of the image. * - * @reject {Error|ServiceError} - The error object. + * @param {object} parameters Parameters supplied to the Create Image + * operation. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * {Array} [result] - The deserialized result object if an error did not occur. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listPublishers(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listPublishers(location: string, callback: ServiceCallback): void; - listPublishers(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a list of virtual machine image SKUs for the specified location, - * publisher, and offer. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @param {string} location The name of a supported Azure region. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @param {string} publisherName A valid image publisher. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @param {string} offer A valid image publisher offer. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * @returns {Promise} A promise is returned + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * - * @reject {Error|ServiceError} - The error object. - */ - listSkusWithHttpOperationResponse(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of virtual machine image SKUs for the specified location, - * publisher, and offer. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {string} location The name of a supported Azure region. + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). * - * @param {string} publisherName A valid image publisher. + * @param {string} parameters.location Resource location * - * @param {string} offer A valid image publisher offer. + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -6976,7 +7837,7 @@ export interface VirtualMachineImages { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {Image} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6984,92 +7845,85 @@ export interface VirtualMachineImages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} for more information. * * {WebResource} [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(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSkus(location: string, publisherName: string, offer: string, callback: ServiceCallback): void; - listSkus(location: string, publisherName: string, offer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * UsageOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface UsageOperations { + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets, for the specified location, the current compute resource usage - * information as well as the limits for compute resources under the - * subscription. - * - * @param {string} location The location for which resource usage is queried. - * - * @param {object} [options] Optional Parameters. + * Update an image. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} resourceGroupName The name of the resource group. * - * @returns {Promise} A promise is returned + * @param {string} imageName The name of the image. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} parameters Parameters supplied to the Update Image + * operation. * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets, for the specified location, the current compute resource usage - * information as well as the limits for compute resources under the - * subscription. + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * @param {string} location The location for which resource usage is queried. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * {Promise} A promise is returned. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @resolve {ListUsagesResult} - The deserialized result object. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListUsagesResult} for more information. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets, for the specified location, the current compute resource usage - * information as well as the limits for compute resources under the - * subscription. + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -7078,136 +7932,20 @@ export interface UsageOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets, for the specified location, the current compute resource usage - * information as well as the limits for compute resources under 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 {ListUsagesResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListUsagesResult} for more information. - * - * {WebResource} [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 - * VirtualMachineSizes - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface VirtualMachineSizes { - - - /** - * Lists all available virtual machine sizes for a subscription in a location. - * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that 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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all available virtual machine sizes for a subscription in a location. - * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {VirtualMachineSizeListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineSizeListResult} for more - * information. - * - * {WebResource} [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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Images - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface Images { - + updateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create or update an image. + * Update an image. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} imageName The name of the image. * - * @param {object} parameters Parameters supplied to the Create Image + * @param {object} parameters Parameters supplied to the Update Image * operation. * * @param {object} [parameters.sourceVirtualMachine] The source virtual machine @@ -7252,9 +7990,9 @@ export interface Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

    @@ -7266,8 +8004,6 @@ export interface Images { * an image is zone resilient or not. Default is false. Zone resilient images * can be created only in regions that provide Zone Redundant Storage (ZRS). * - * @param {string} parameters.location Resource location - * * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. @@ -7275,83 +8011,59 @@ export interface Images { * @param {object} [options.customHeaders] Headers that 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, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create or update an image. - * - * @param {string} resourceGroupName The name of the resource group. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} imageName The name of the image. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} parameters Parameters supplied to the Create Image - * operation. + * {Promise} A promise is returned. * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. + * @resolve {Image} - The deserialized result object. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} for more information. * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an Image. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. + * @param {string} imageName The name of the image. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @param {object} [options] Optional Parameters. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * @returns {Promise} A promise is returned * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an Image. * - * @param {string} parameters.location Resource location + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags + * @param {string} imageName The name of the image. * * @param {object} [options] Optional Parameters. * @@ -7365,7 +8077,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {Image} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7373,290 +8085,48 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Image} [result] - The deserialized result object if an error did not occur. - * See {@link Image} for more information. + * {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. */ - createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Update an image. + * Gets an image. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} imageName The name of the image. * - * @param {object} parameters Parameters supplied to the Update Image + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the * operation. * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @returns {Promise} A promise is returned * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets an image. * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * @param {string} imageName The name of the image. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. - * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id - * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. - * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' - * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB - * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' - * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). - * - * @param {object} [parameters.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. - */ - updateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Update an image. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} imageName The name of the image. - * - * @param {object} parameters Parameters supplied to the Update Image - * operation. - * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. - * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. - * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' - * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' - * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. - * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. - * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id - * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. - * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' - * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB - * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' - * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). - * - * @param {object} [parameters.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 {Image} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Image} [result] - The deserialized result object if an error did not occur. - * See {@link Image} for more information. - * - * {WebResource} [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, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes an Image. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} imageName The name of the image. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that 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, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes an Image. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} imageName The name of the image. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {OperationStatusResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. - * - * {WebResource} [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, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets an image. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} imageName The name of the image. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] The expand expression to apply on the - * operation. - * - * @param {object} [options.customHeaders] Headers that 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, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets an image. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} imageName The name of the image. - * - * @param {object} [options] Optional Parameters. + * @param {object} [options] Optional Parameters. * * @param {string} [options.expand] The expand expression to apply on the * operation. @@ -7853,9 +8323,9 @@ export interface Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

    @@ -7936,9 +8406,9 @@ export interface Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

    @@ -8038,9 +8508,9 @@ export interface Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

    @@ -8119,9 +8589,9 @@ export interface Images { * be larger than 1023 GB * * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. UltraSSD_LRS cannot + * be used with OS Disk. Possible values include: 'Standard_LRS', + * 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

    @@ -8181,11 +8651,11 @@ export interface Images { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes an Image. @@ -8206,7 +8676,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8214,17 +8684,15 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -8436,9 +8904,19 @@ export interface VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -8546,6 +9024,13 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -8617,6 +9102,22 @@ export interface VirtualMachineScaleSets { * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -8643,9 +9144,10 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -8653,6 +9155,19 @@ export interface VirtualMachineScaleSets { * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -8679,9 +9194,8 @@ export interface VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -8716,6 +9230,11 @@ export interface VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -8738,10 +9257,10 @@ export interface VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -8844,9 +9363,19 @@ export interface VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -8954,10 +9483,17 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * - * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] - * Specifies set of certificates that should be installed onto the virtual - * machines in the scale set. - * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies * the storage settings for the virtual machine disks. * @@ -9025,6 +9561,22 @@ export interface VirtualMachineScaleSets { * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -9051,9 +9603,10 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -9061,6 +9614,19 @@ export interface VirtualMachineScaleSets { * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -9087,9 +9653,8 @@ export interface VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -9124,6 +9689,11 @@ export interface VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -9146,10 +9716,10 @@ export interface VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -9267,9 +9837,19 @@ export interface VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -9329,6 +9909,13 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -9377,6 +9964,12 @@ export interface VirtualMachineScaleSets { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -9397,9 +9990,10 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -9417,9 +10011,8 @@ export interface VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -9457,10 +10050,10 @@ export interface VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -9554,9 +10147,19 @@ export interface VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -9616,6 +10219,13 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -9664,6 +10274,12 @@ export interface VirtualMachineScaleSets { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -9684,9 +10300,10 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -9704,9 +10321,8 @@ export interface VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -9744,10 +10360,10 @@ export interface VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -9798,11 +10414,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes a VM scale set. @@ -9823,7 +10439,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9831,17 +10447,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -9925,11 +10539,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + deallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deallocates specific virtual machines in a VM scale set. Shuts down the @@ -9957,7 +10571,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9965,17 +10579,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - deallocate(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - deallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - deallocate(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + deallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -9994,11 +10606,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes virtual machines in a VM scale set. @@ -10021,7 +10633,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10029,17 +10641,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; - deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10278,6 +10888,66 @@ export interface VirtualMachineScaleSets { listSkus(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getOSUpgradeHistoryWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineScaleSetListOSUpgradeHistory} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualMachineScaleSetListOSUpgradeHistory} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Power off (stop) one or more virtual machines in a VM scale set. Note that * resources are still attached and you are getting charged for the resources. @@ -10299,11 +10969,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - powerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + powerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Power off (stop) one or more virtual machines in a VM scale set. Note that @@ -10331,7 +11001,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10339,17 +11009,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - powerOff(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - powerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - powerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + powerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10371,11 +11039,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - restartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + restartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Restarts one or more virtual machines in a VM scale set. @@ -10401,7 +11069,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10409,17 +11077,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - restart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - restart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10441,11 +11107,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + startWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Starts one or more virtual machines in a VM scale set. @@ -10471,7 +11137,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10479,17 +11145,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - start(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10511,11 +11175,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - redeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + redeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Redeploy one or more virtual machines in a VM scale set. @@ -10541,7 +11205,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10549,21 +11213,22 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - redeploy(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - redeploy(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - redeploy(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + redeploy(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -10581,14 +11246,17 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -10611,7 +11279,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10619,17 +11287,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - performMaintenance(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - performMaintenance(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - performMaintenance(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10649,11 +11315,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Upgrades one or more virtual machines to the latest SKU set in the VM scale @@ -10677,7 +11343,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10685,17 +11351,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; - updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10718,11 +11382,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - reimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + reimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Reimages (upgrade the operating system) one or more virtual machines in a VM @@ -10749,7 +11413,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10757,17 +11421,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - reimage(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - reimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - reimage(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + reimage(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + reimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + reimage(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10790,11 +11452,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - reimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + reimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Reimages all the disks ( including data disks ) in the virtual machines in a @@ -10821,7 +11483,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10829,17 +11491,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - reimageAll(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - reimageAll(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - reimageAll(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + reimageAll(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + reimageAll(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + reimageAll(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10991,9 +11651,19 @@ export interface VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -11101,6 +11771,13 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -11172,6 +11849,22 @@ export interface VirtualMachineScaleSets { * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -11198,9 +11891,10 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -11208,6 +11902,19 @@ export interface VirtualMachineScaleSets { * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -11234,9 +11941,8 @@ export interface VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -11271,6 +11977,11 @@ export interface VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -11293,10 +12004,10 @@ export interface VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -11399,9 +12110,19 @@ export interface VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -11509,6 +12230,13 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -11580,6 +12308,22 @@ export interface VirtualMachineScaleSets { * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -11606,9 +12350,10 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -11616,6 +12361,19 @@ export interface VirtualMachineScaleSets { * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -11642,9 +12400,8 @@ export interface VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -11679,6 +12436,11 @@ export interface VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -11701,10 +12463,10 @@ export interface VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -11822,9 +12584,19 @@ export interface VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -11884,6 +12656,13 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -11932,6 +12711,12 @@ export interface VirtualMachineScaleSets { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -11952,9 +12737,10 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -11972,9 +12758,8 @@ export interface VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -12012,10 +12797,10 @@ export interface VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -12109,9 +12894,19 @@ export interface VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -12171,6 +12966,13 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -12219,6 +13021,12 @@ export interface VirtualMachineScaleSets { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -12239,9 +13047,10 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -12259,9 +13068,8 @@ export interface VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -12299,10 +13107,10 @@ export interface VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -12353,11 +13161,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes a VM scale set. @@ -12378,7 +13186,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12386,17 +13194,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12420,11 +13226,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deallocates specific virtual machines in a VM scale set. Shuts down the @@ -12452,7 +13258,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12460,17 +13266,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12489,11 +13293,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes virtual machines in a VM scale set. @@ -12516,7 +13320,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12524,17 +13328,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; - beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12558,11 +13360,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Power off (stop) one or more virtual machines in a VM scale set. Note that @@ -12590,7 +13392,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12598,17 +13400,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12630,11 +13430,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRestartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Restarts one or more virtual machines in a VM scale set. @@ -12660,7 +13460,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12668,17 +13468,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginRestart(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - beginRestart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginRestart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12700,11 +13498,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Starts one or more virtual machines in a VM scale set. @@ -12730,7 +13528,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12738,17 +13536,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginStart(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - beginStart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12770,11 +13566,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Redeploy one or more virtual machines in a VM scale set. @@ -12800,7 +13596,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12808,21 +13604,22 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginRedeploy(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - beginRedeploy(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginRedeploy(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -12840,14 +13637,17 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -12870,7 +13670,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12878,17 +13678,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12908,11 +13706,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Upgrades one or more virtual machines to the latest SKU set in the VM scale @@ -12936,7 +13734,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12944,17 +13742,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; - beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12977,11 +13773,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginReimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + beginReimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Reimages (upgrade the operating system) one or more virtual machines in a VM @@ -13008,7 +13804,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13016,17 +13812,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginReimage(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - beginReimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginReimage(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginReimage(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginReimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginReimage(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -13049,11 +13843,11 @@ export interface VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginReimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + beginReimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Reimages all the disks ( including data disks ) in the virtual machines in a @@ -13080,7 +13874,7 @@ export interface VirtualMachineScaleSets { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13088,17 +13882,15 @@ export interface VirtualMachineScaleSets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginReimageAll(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; - beginReimageAll(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginReimageAll(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -13281,19 +14073,77 @@ export interface VirtualMachineScaleSets { listSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; listSkusNext(nextPageLink: string, callback: ServiceCallback): void; listSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualMachineScaleSetExtensions - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface VirtualMachineScaleSetExtensions { /** - * The operation to create or update an extension. + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getOSUpgradeHistoryNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the 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 {VirtualMachineScaleSetListOSUpgradeHistory} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualMachineScaleSetListOSUpgradeHistory} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getOSUpgradeHistoryNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getOSUpgradeHistoryNext(nextPageLink: string, callback: ServiceCallback): void; + getOSUpgradeHistoryNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineScaleSetExtensions + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineScaleSetExtensions { + + + /** + * The operation to create or update an extension. * * @param {string} resourceGroupName The name of the resource group. * @@ -13435,11 +14285,11 @@ export interface VirtualMachineScaleSetExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to delete the extension. @@ -13463,7 +14313,7 @@ export interface VirtualMachineScaleSetExtensions { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13471,17 +14321,15 @@ export interface VirtualMachineScaleSetExtensions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -13761,11 +14609,11 @@ export interface VirtualMachineScaleSetExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to delete the extension. @@ -13789,7 +14637,7 @@ export interface VirtualMachineScaleSetExtensions { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13797,17 +14645,15 @@ export interface VirtualMachineScaleSetExtensions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -13891,11 +14737,11 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Cancels the current virtual machine scale set rolling upgrade. @@ -13916,7 +14762,7 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13924,17 +14770,15 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - cancel(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancel(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -13953,11 +14797,11 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startOSUpgradeWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + startOSUpgradeWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Starts a rolling upgrade to move all virtual machine scale set instances to @@ -13980,7 +14824,7 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13988,17 +14832,77 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. + */ + startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + startExtensionUpgradeWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. */ - startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + startExtensionUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + startExtensionUpgrade(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + startExtensionUpgrade(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -14075,11 +14979,11 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCancelWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCancelWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Cancels the current virtual machine scale set rolling upgrade. @@ -14100,7 +15004,7 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14108,17 +15012,15 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginCancel(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCancel(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginCancel(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCancel(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCancel(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginCancel(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -14137,11 +15039,11 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartOSUpgradeWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartOSUpgradeWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Starts a rolling upgrade to move all virtual machine scale set instances to @@ -14164,7 +15066,7 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14172,17 +15074,77 @@ export interface VirtualMachineScaleSetRollingUpgrades { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. + */ + beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginStartExtensionUpgradeWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. */ - beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStartExtensionUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartExtensionUpgrade(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginStartExtensionUpgrade(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -14211,11 +15173,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - reimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + reimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Reimages (upgrade the operating system) a specific virtual machine in a VM @@ -14239,7 +15201,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14247,17 +15209,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -14277,11 +15237,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - reimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + reimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Allows you to re-image all the disks ( including data disks ) in the a VM @@ -14305,7 +15265,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14313,17 +15273,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -14345,11 +15303,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deallocates a specific virtual machine in a VM scale set. Shuts down the @@ -14375,7 +15333,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14383,17 +15341,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -14565,6 +15521,14 @@ export interface VirtualMachineScaleSetVMs { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -14577,7 +15541,7 @@ export interface VirtualMachineScaleSetVMs { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -14585,9 +15549,9 @@ export interface VirtualMachineScaleSetVMs { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -14598,6 +15562,17 @@ export interface VirtualMachineScaleSetVMs { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -14694,9 +15669,20 @@ export interface VirtualMachineScaleSetVMs { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -14709,9 +15695,8 @@ export interface VirtualMachineScaleSetVMs { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -14949,6 +15934,14 @@ export interface VirtualMachineScaleSetVMs { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -14961,7 +15954,7 @@ export interface VirtualMachineScaleSetVMs { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -14969,9 +15962,9 @@ export interface VirtualMachineScaleSetVMs { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -14982,6 +15975,17 @@ export interface VirtualMachineScaleSetVMs { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -15078,9 +16082,20 @@ export interface VirtualMachineScaleSetVMs { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -15093,9 +16108,8 @@ export interface VirtualMachineScaleSetVMs { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -15200,11 +16214,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes a virtual machine from a VM scale set. @@ -15227,7 +16241,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15235,17 +16249,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -15468,11 +16480,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - powerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + powerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Power off (stop) a virtual machine in a VM scale set. Note that resources @@ -15497,7 +16509,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15505,17 +16517,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -15534,11 +16544,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - restartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Restarts a virtual machine in a VM scale set. @@ -15561,7 +16571,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15569,17 +16579,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -15598,11 +16606,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + startWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Starts a virtual machine in a VM scale set. @@ -15625,7 +16633,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15633,17 +16641,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -15662,11 +16668,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - redeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + redeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Redeploys a virtual machine in a VM scale set. @@ -15689,7 +16695,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15697,17 +16703,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -15726,11 +16730,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Performs maintenance on a virtual machine in a VM scale set. @@ -15753,7 +16757,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15761,22 +16765,19 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM - * scale set. + * Run command on a virtual machine in a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * @@ -15784,6 +16785,16 @@ export interface VirtualMachineScaleSetVMs { * * @param {string} instanceId The instance ID of the virtual machine. * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15791,11 +16802,85 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + runCommandWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RunCommandResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RunCommandResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + runCommand(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + runCommand(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.RunCommandInput, callback: ServiceCallback): void; + runCommand(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginReimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginReimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Reimages (upgrade the operating system) a specific virtual machine in a VM @@ -15819,7 +16904,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15827,17 +16912,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -15857,11 +16940,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginReimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginReimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Allows you to re-image all the disks ( including data disks ) in the a VM @@ -15885,7 +16968,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15893,17 +16976,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -15925,11 +17006,11 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deallocates a specific virtual machine in a VM scale set. Shuts down the @@ -15955,7 +17036,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15963,17 +17044,15 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -16145,6 +17224,14 @@ export interface VirtualMachineScaleSetVMs { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -16157,7 +17244,7 @@ export interface VirtualMachineScaleSetVMs { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -16165,9 +17252,9 @@ export interface VirtualMachineScaleSetVMs { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -16178,6 +17265,17 @@ export interface VirtualMachineScaleSetVMs { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -16274,9 +17372,20 @@ export interface VirtualMachineScaleSetVMs { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -16289,9 +17398,8 @@ export interface VirtualMachineScaleSetVMs { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -16529,6 +17637,14 @@ export interface VirtualMachineScaleSetVMs { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -16541,7 +17657,7 @@ export interface VirtualMachineScaleSetVMs { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -16549,9 +17665,9 @@ export interface VirtualMachineScaleSetVMs { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -16562,6 +17678,17 @@ export interface VirtualMachineScaleSetVMs { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -16604,132 +17731,2186 @@ export interface VirtualMachineScaleSetVMs { * repair disks on Azure Linux VMs using the VMAccess * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) * - * @param {string} [parameters.osProfile.customData] Specifies a base-64 - * encoded string of custom data. The base-64 encoded string is decoded to a - * binary array that is saved as a file on the Virtual Machine. The maximum - * length of the binary array is 65535 bytes.

    For using cloud-init for - * your VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.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 {VirtualMachineScaleSetVM} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualMachineScaleSetVM} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVM} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRestartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginStartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRunCommandWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RunCommandResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RunCommandResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginRunCommand(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRunCommand(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.RunCommandInput, callback: ServiceCallback): void; + beginRunCommand(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} nextPageLink The NextLink from the 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 {VirtualMachineScaleSetVMListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualMachineScaleSetVMListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVMListResult} for more + * information. + * + * {WebResource} [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 + * LogAnalytics + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface LogAnalytics { + + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + exportRequestRateByIntervalWithHttpOperationResponse(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LogAnalyticsOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link LogAnalyticsOperationResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, callback: ServiceCallback): void; + exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + exportThrottledRequestsWithHttpOperationResponse(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LogAnalyticsOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link LogAnalyticsOperationResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, callback: ServiceCallback): void; + exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginExportRequestRateByIntervalWithHttpOperationResponse(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LogAnalyticsOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link LogAnalyticsOperationResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, callback: ServiceCallback): void; + beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginExportThrottledRequestsWithHttpOperationResponse(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LogAnalyticsOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link LogAnalyticsOperationResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, callback: ServiceCallback): void; + beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineRunCommands + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineRunCommands { + + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RunCommandListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RunCommandListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandListResult} for more information. + * + * {WebResource} [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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets specific run command for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {string} commandId The command 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. + */ + getWithHttpOperationResponse(location: string, commandId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets specific run command for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {string} commandId The command 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 {RunCommandDocument} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RunCommandDocument} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandDocument} for more information. + * + * {WebResource} [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(location: string, commandId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(location: string, commandId: string, callback: ServiceCallback): void; + get(location: string, commandId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available run commands for a subscription in a 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 {RunCommandListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RunCommandListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandListResult} for more information. + * + * {WebResource} [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 + * ResourceSkus + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface ResourceSkus { + + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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>; + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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 {ResourceSkusResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {WebResource} [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; + + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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>; + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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 {ResourceSkusResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {WebResource} [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 + * Disks + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Disks { + + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Image Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.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, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Image Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.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 {Disk} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} for more information. + * + * {WebResource} [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, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Disk} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} for more information. + * + * {WebResource} [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, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Disk} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} for more information. + * + * {WebResource} [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, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the disks under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all the disks under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DiskList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DiskList} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} for more information. + * + * {WebResource} [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; + + + /** + * Lists all the disks under 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>; + + /** + * Lists all the disks under 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 {DiskList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DiskList} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} for more information. + * + * {WebResource} [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; + + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.osProfile.windowsConfiguration] Specifies - * Windows operating system settings on the virtual machine. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates - * whether virtual machine agent should be provisioned on the virtual machine. - *

    When this property is not specified in the request body, default - * behavior is to set it to true. This will ensure that VM Agent is installed - * on the VM so that extensions can be added to the VM later. + * @returns {Promise} A promise is returned * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates - * whether virtual machine is enabled for automatic updates. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] - * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @reject {Error|ServiceError} - The error object. + */ + grantAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Grants access to a disk. * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] - * Specifies additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file, which is used by Windows Setup. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies - * the Windows Remote Management listeners. This enables remote Windows - * PowerShell. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * The list of Windows Remote Management listeners + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. * - * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the - * Linux operating system settings on the virtual machine.

    For a list - * of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * Specifies whether password authentication should be disabled. + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the - * ssh key configuration for a Linux OS. + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The - * list of SSH public keys used to authenticate with linux based VMs. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.osProfile.secrets] Specifies set of certificates - * that should be installed onto the virtual machine. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.networkProfile] Specifies the network interfaces - * of the virtual machine. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the - * list of resource Ids for the network interfaces associated with the virtual - * machine. + * {Promise} A promise is returned. * - * @param {object} [parameters.diagnosticsProfile] Specifies the boot - * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * @resolve {AccessUri} - The deserialized result object. * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot - * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a - * screenshot of the VM from the hypervisor. + * @reject {Error|ServiceError} - The error object. * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * Whether boot diagnostics should be enabled on the Virtual Machine. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * Uri of the storage account to use for placing the console output and - * screenshot. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [parameters.availabilitySet] Specifies information about the - * availability set that the virtual machine should be assigned to. Virtual - * machines specified in the same availability set are allocated to different - * nodes to maximize availability. For more information about availability - * sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * {AccessUri} [result] - The deserialized result object if an error did not occur. + * See {@link AccessUri} for more information. * - * @param {string} [parameters.availabilitySet.id] Resource Id + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.licenseType] Specifies that the image or disk - * that is being used was licensed on-premises. This element is only used for - * images that contain the Windows Server operating system.

    Possible - * values are:

    Windows_Client

    Windows_Server

    If this - * element is included in a request for an update, the value must match the - * initial value. This value cannot be updated.

    For more information, - * see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Minimum api-version: 2015-06-15 + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; + grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Revokes access to a disk. * - * @param {object} [parameters.plan] Specifies information about the - * marketplace image used to create the virtual machine. This element is only - * used for marketplace images. Before you can use a marketplace image from an - * API, you must enable the image for programmatic use. In the Azure portal, - * find the marketplace image that you want to use and then click **Want to - * deploy programmatically, Get Started ->**. Enter any required information - * and then click **Save**. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.plan.name] The plan ID. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * - * @param {string} [parameters.plan.publisher] The publisher ID. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.plan.promotionCode] The promotion code. + * @returns {Promise} A promise is returned * - * @param {string} parameters.location Resource location + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.tags] Resource tags + * @reject {Error|ServiceError} - The error object. + */ + revokeAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -16743,7 +19924,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineScaleSetVM} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16751,27 +19932,114 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineScaleSetVM} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineScaleSetVM} for more - * information. + * {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. */ - beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + revokeAccess(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + revokeAccess(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + revokeAccess(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a virtual machine from a VM scale set. + * Creates or updates a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Image Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * + * @param {string} disk.location Resource location * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {object} [disk.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -16780,88 +20048,109 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a virtual machine from a VM scale set. + * Creates or updates a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. * - * @param {object} [options] Optional Parameters. + * @param {object} [disk.sku] * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {array} [disk.zones] The Logical zone list for Disk. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' * - * {Promise} A promise is returned. + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' * - * @reject {Error|ServiceError} - The error object. + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [disk.creationData.imageReference] Disk source information. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Image Repository or user image reference. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources - * are still attached and you are getting charged for the resources. Instead, - * use deallocate to release resources and avoid charges. + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. * - * @param {string} resourceGroupName The name of the resource group. + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. * - * @param {string} vmScaleSetName The name of the VM scale set. + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. * - * @param {object} [options] Optional Parameters. + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret * - * @returns {Promise} A promise is returned + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key * - * @reject {Error|ServiceError} - The error object. - */ - beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources - * are still attached and you are getting charged for the resources. Instead, - * use deallocate to release resources and avoid charges. + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id * - * @param {string} vmScaleSetName The name of the VM scale set. + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -16875,7 +20164,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {Disk} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16883,27 +20172,84 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Restarts a virtual machine in a VM scale set. + * Updates (patches) a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {object} [options] Optional Parameters. * @@ -16912,20 +20258,78 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRestartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Restarts a virtual machine in a VM scale set. + * Updates (patches) a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {number} [disk.diskIOPSReadWrite] The number of IOPS allowed for this + * disk; only settable for UltraSSD disks. One operation can transfer between + * 4k and 256k bytes. + * + * @param {number} [disk.diskMBpsReadWrite] The bandwidth allowed for this + * disk; only settable for UltraSSD disks. MBps means millions of bytes per + * second - MB here uses the ISO notation, of powers of 10. + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {object} [options] Optional Parameters. * @@ -16939,7 +20343,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {Disk} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16947,27 +20351,27 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Starts a virtual machine in a VM scale set. + * Deletes a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. - * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -16976,20 +20380,21 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Starts a virtual machine in a VM scale set. + * Deletes a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. - * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17003,7 +20408,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17011,27 +20416,35 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Redeploys a virtual machine in a VM scale set. + * Grants access to a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. * * @param {object} [options] Optional Parameters. * @@ -17040,20 +20453,30 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGrantAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Redeploys a virtual machine in a VM scale set. + * Grants access to a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. * * @param {object} [options] Optional Parameters. * @@ -17067,7 +20490,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {AccessUri} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17075,27 +20498,27 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {AccessUri} [result] - The deserialized result object if an error did not occur. + * See {@link AccessUri} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; + beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Performs maintenance on a virtual machine in a VM scale set. + * Revokes access to a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. - * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17104,20 +20527,21 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRevokeAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Performs maintenance on a virtual machine in a VM scale set. + * Revokes access to a disk. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the VM scale set. - * - * @param {string} instanceId The instance ID of the virtual machine. + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17131,7 +20555,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17139,21 +20563,19 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; - beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRevokeAccess(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRevokeAccess(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + beginRevokeAccess(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of all virtual machines in a VM scale sets. + * Lists all the disks under a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -17165,14 +20587,14 @@ export interface VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of all virtual machines in a VM scale sets. + * Lists all the disks under a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -17189,7 +20611,7 @@ export interface VirtualMachineScaleSetVMs { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineScaleSetVMListResult} - The deserialized result object. + * @resolve {DiskList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17197,57 +20619,23 @@ export interface VirtualMachineScaleSetVMs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineScaleSetVMListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineScaleSetVMListResult} for more - * information. + * {DiskList} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} for more information. * * {WebResource} [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 - * LogAnalytics - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface LogAnalytics { + 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; /** - * Export logs that show Api requests made by this subscription in the given - * time window to show throttling activities. - * - * @param {object} parameters Parameters supplied to the LogAnalytics - * getRequestRateByInterval Api. - * - * @param {string} parameters.intervalLength Interval value in minutes used to - * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', - * 'FiveMins', 'ThirtyMins', 'SixtyMins' - * - * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob - * container to which LogAnalytics Api writes output logs to. - * - * @param {date} parameters.fromTime From time of the query - * - * @param {date} parameters.toTime To time of the query - * - * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by - * Throttle Policy applied. - * - * @param {boolean} [parameters.groupByOperationName] Group query result by by - * Operation Name. - * - * @param {boolean} [parameters.groupByResourceName] Group query result by - * Resource Name. + * Lists all the disks under a subscription. * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -17256,41 +20644,17 @@ export interface LogAnalytics { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - exportRequestRateByIntervalWithHttpOperationResponse(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Export logs that show Api requests made by this subscription in the given - * time window to show throttling activities. - * - * @param {object} parameters Parameters supplied to the LogAnalytics - * getRequestRateByInterval Api. - * - * @param {string} parameters.intervalLength Interval value in minutes used to - * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', - * 'FiveMins', 'ThirtyMins', 'SixtyMins' - * - * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob - * container to which LogAnalytics Api writes output logs to. - * - * @param {date} parameters.fromTime From time of the query - * - * @param {date} parameters.toTime To time of the query - * - * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by - * Throttle Policy applied. - * - * @param {boolean} [parameters.groupByOperationName] Group query result by by - * Operation Name. - * - * @param {boolean} [parameters.groupByResourceName] Group query result by - * Resource Name. + * Lists all the disks under a subscription. * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -17304,7 +20668,7 @@ export interface LogAnalytics { * * {Promise} A promise is returned. * - * @resolve {LogAnalyticsOperationResult} - The deserialized result object. + * @resolve {DiskList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17312,44 +20676,115 @@ export interface LogAnalytics { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link LogAnalyticsOperationResult} for more - * information. + * {DiskList} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, callback: ServiceCallback): void; - exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * Snapshots + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Snapshots { /** - * Export logs that show total throttled Api requests for this subscription in - * the given time window. + * Creates or updates a snapshot. * - * @param {object} parameters Parameters supplied to the LogAnalytics - * getThrottledRequests Api. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob - * container to which LogAnalytics Api writes output logs to. + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Image Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault * - * @param {date} parameters.fromTime From time of the query + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key * - * @param {date} parameters.toTime To time of the query + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret * - * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by - * Throttle Policy applied. + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id * - * @param {boolean} [parameters.groupByOperationName] Group query result by by - * Operation Name. + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault * - * @param {boolean} [parameters.groupByResourceName] Group query result by - * Resource Name. + * @param {string} snapshot.location Resource location * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {object} [snapshot.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -17358,37 +20793,100 @@ export interface LogAnalytics { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - exportThrottledRequestsWithHttpOperationResponse(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Export logs that show total throttled Api requests for this subscription in - * the given time window. + * Creates or updates a snapshot. * - * @param {object} parameters Parameters supplied to the LogAnalytics - * getThrottledRequests Api. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob - * container to which LogAnalytics Api writes output logs to. + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * - * @param {date} parameters.fromTime From time of the query + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. * - * @param {date} parameters.toTime To time of the query + * @param {object} [snapshot.sku] * - * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by - * Throttle Policy applied. + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * - * @param {boolean} [parameters.groupByOperationName] Group query result by by - * Operation Name. + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' * - * @param {boolean} [parameters.groupByResourceName] Group query result by - * Resource Name. + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Image Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -17402,7 +20900,7 @@ export interface LogAnalytics { * * {Promise} A promise is returned. * - * @resolve {LogAnalyticsOperationResult} - The deserialized result object. + * @resolve {Snapshot} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17410,48 +20908,76 @@ export interface LogAnalytics { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link LogAnalyticsOperationResult} for more - * information. + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, callback: ServiceCallback): void; - exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Export logs that show Api requests made by this subscription in the given - * time window to show throttling activities. + * Updates (patches) a snapshot. * - * @param {object} parameters Parameters supplied to the LogAnalytics - * getRequestRateByInterval Api. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.intervalLength Interval value in minutes used to - * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', - * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * - * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob - * container to which LogAnalytics Api writes output logs to. + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. * - * @param {date} parameters.fromTime From time of the query + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' * - * @param {date} parameters.toTime To time of the query + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. * - * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by - * Throttle Policy applied. + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot * - * @param {boolean} [parameters.groupByOperationName] Group query result by by - * Operation Name. + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. * - * @param {boolean} [parameters.groupByResourceName] Group query result by - * Resource Name. + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -17460,41 +20986,70 @@ export interface LogAnalytics { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginExportRequestRateByIntervalWithHttpOperationResponse(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Export logs that show Api requests made by this subscription in the given - * time window to show throttling activities. + * Updates (patches) a snapshot. * - * @param {object} parameters Parameters supplied to the LogAnalytics - * getRequestRateByInterval Api. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.intervalLength Interval value in minutes used to - * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', - * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * - * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob - * container to which LogAnalytics Api writes output logs to. + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. * - * @param {date} parameters.fromTime From time of the query + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' * - * @param {date} parameters.toTime To time of the query + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. * - * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by - * Throttle Policy applied. + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id * - * @param {boolean} [parameters.groupByOperationName] Group query result by by - * Operation Name. + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault * - * @param {boolean} [parameters.groupByResourceName] Group query result by - * Resource Name. + * @param {object} [snapshot.tags] Resource tags * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -17508,7 +21063,7 @@ export interface LogAnalytics { * * {Promise} A promise is returned. * - * @resolve {LogAnalyticsOperationResult} - The deserialized result object. + * @resolve {Snapshot} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17516,44 +21071,27 @@ export interface LogAnalytics { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link LogAnalyticsOperationResult} for more - * information. + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, callback: ServiceCallback): void; - beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Export logs that show total throttled Api requests for this subscription in - * the given time window. - * - * @param {object} parameters Parameters supplied to the LogAnalytics - * getThrottledRequests Api. - * - * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob - * container to which LogAnalytics Api writes output logs to. - * - * @param {date} parameters.fromTime From time of the query - * - * @param {date} parameters.toTime To time of the query - * - * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by - * Throttle Policy applied. - * - * @param {boolean} [parameters.groupByOperationName] Group query result by by - * Operation Name. + * Gets information about a snapshot. * - * @param {boolean} [parameters.groupByResourceName] Group query result by - * Resource Name. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17562,37 +21100,21 @@ export interface LogAnalytics { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginExportThrottledRequestsWithHttpOperationResponse(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Export logs that show total throttled Api requests for this subscription in - * the given time window. - * - * @param {object} parameters Parameters supplied to the LogAnalytics - * getThrottledRequests Api. - * - * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob - * container to which LogAnalytics Api writes output logs to. - * - * @param {date} parameters.fromTime From time of the query - * - * @param {date} parameters.toTime To time of the query - * - * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by - * Throttle Policy applied. - * - * @param {boolean} [parameters.groupByOperationName] Group query result by by - * Operation Name. + * Gets information about a snapshot. * - * @param {boolean} [parameters.groupByResourceName] Group query result by - * Resource Name. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17606,7 +21128,7 @@ export interface LogAnalytics { * * {Promise} A promise is returned. * - * @resolve {LogAnalyticsOperationResult} - The deserialized result object. + * @resolve {Snapshot} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17614,32 +21136,27 @@ export interface LogAnalytics { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link LogAnalyticsOperationResult} for more - * information. + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, callback: ServiceCallback): void; - beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualMachineRunCommands - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface VirtualMachineRunCommands { + get(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all available run commands for a subscription in a location. + * Deletes a snapshot. * - * @param {string} location The location upon which run commands is queried. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17648,16 +21165,21 @@ export interface VirtualMachineRunCommands { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all available run commands for a subscription in a location. + * Deletes a snapshot. * - * @param {string} location The location upon which run commands is queried. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17671,7 +21193,7 @@ export interface VirtualMachineRunCommands { * * {Promise} A promise is returned. * - * @resolve {RunCommandListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17679,24 +21201,21 @@ export interface VirtualMachineRunCommands { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RunCommandListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RunCommandListResult} for more information. + * {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. */ - list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets specific run command for a subscription in a location. - * - * @param {string} location The location upon which run commands is queried. + * Lists snapshots under a resource group. * - * @param {string} commandId The command id. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -17705,18 +21224,16 @@ export interface VirtualMachineRunCommands { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(location: string, commandId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets specific run command for a subscription in a location. - * - * @param {string} location The location upon which run commands is queried. + * Lists snapshots under a resource group. * - * @param {string} commandId The command id. + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -17730,7 +21247,7 @@ export interface VirtualMachineRunCommands { * * {Promise} A promise is returned. * - * @resolve {RunCommandDocument} - The deserialized result object. + * @resolve {SnapshotList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17738,23 +21255,20 @@ export interface VirtualMachineRunCommands { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RunCommandDocument} [result] - The deserialized result object if an error did not occur. - * See {@link RunCommandDocument} for more information. + * {SnapshotList} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} for more information. * * {WebResource} [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(location: string, commandId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(location: string, commandId: string, callback: ServiceCallback): void; - get(location: string, commandId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Lists all available run commands for a subscription in a location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists snapshots under a subscription. * * @param {object} [options] Optional Parameters. * @@ -17763,17 +21277,14 @@ export interface VirtualMachineRunCommands { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all available run commands for a subscription in a location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists snapshots under a subscription. * * @param {object} [options] Optional Parameters. * @@ -17787,7 +21298,7 @@ export interface VirtualMachineRunCommands { * * {Promise} A promise is returned. * - * @resolve {RunCommandListResult} - The deserialized result object. + * @resolve {SnapshotList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17795,29 +21306,36 @@ export interface VirtualMachineRunCommands { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RunCommandListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RunCommandListResult} for more information. + * {SnapshotList} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} for more information. * * {WebResource} [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 - * ResourceSkus - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface ResourceSkus { + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. * * @param {object} [options] Optional Parameters. * @@ -17826,14 +21344,30 @@ export interface ResourceSkus { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + grantAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. * * @param {object} [options] Optional Parameters. * @@ -17847,7 +21381,7 @@ export interface ResourceSkus { * * {Promise} A promise is returned. * - * @resolve {ResourceSkusResult} - The deserialized result object. + * @resolve {AccessUri} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17855,23 +21389,27 @@ export interface ResourceSkus { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ResourceSkusResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceSkusResult} for more information. + * {AccessUri} [result] - The deserialized result object if an error did not occur. + * See {@link AccessUri} for more information. * * {WebResource} [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; + grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; + grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17880,17 +21418,21 @@ export interface ResourceSkus { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + revokeAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * Revokes access to a snapshot. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -17904,7 +21446,7 @@ export interface ResourceSkus { * * {Promise} A promise is returned. * - * @resolve {ResourceSkusResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17912,116 +21454,105 @@ export interface ResourceSkus { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ResourceSkusResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceSkusResult} for more information. + * {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. */ - 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 - * Disks - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface Disks { + revokeAccess(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + revokeAccess(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + revokeAccess(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a disk. + * Creates or updates a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 * characters. * - * @param {object} disk Disk object supplied in the body of the Put disk - * operation. - * - * @param {object} [disk.sku] + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. * - * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {object} [snapshot.sku] * - * @param {array} [disk.zones] The Logical zone list for Disk. + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * - * @param {string} [disk.osType] The Operating System type. Possible values + * @param {string} [snapshot.osType] The Operating System type. Possible values * include: 'Windows', 'Linux' * - * @param {object} disk.creationData Disk source information. CreationData + * @param {object} snapshot.creationData Disk source information. CreationData * information cannot be changed after the disk has been created. * - * @param {string} disk.creationData.createOption This enumerates the possible - * sources of a disk's creation. Possible values include: 'Empty', 'Attach', - * 'FromImage', 'Import', 'Copy', 'Restore' + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' * - * @param {string} [disk.creationData.storageAccountId] If createOption is + * @param {string} [snapshot.creationData.storageAccountId] If createOption is * Import, the Azure Resource Manager identifier of the storage account * containing the blob to import as a disk. Required only if the blob is in a * different subscription * - * @param {object} [disk.creationData.imageReference] Disk source information. + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. * - * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Image Repository or user image reference. * - * @param {number} [disk.creationData.imageReference.lun] If the disk is + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of * the data disks in the image to use. For OS disks, this field is null. * - * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, * this is the URI of a blob to be imported into a managed disk. * - * @param {string} [disk.creationData.sourceResourceId] If createOption is + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is * Copy, this is the ARM id of the source snapshot or disk. * - * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, * this field is mandatory and it indicates the size of the VHD to create. If * this field is present for updates or creation with other options, it * indicates a resize. Resizes are only allowed if the disk is not attached to * a running VM, and can only increase the disk's size. * - * @param {object} [disk.encryptionSettings] Encryption settings for disk or - * snapshot + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot * - * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and - * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable * encryption. Set this flag to false and remove DiskEncryptionKey and * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the * request object, the existing settings remain unchanged. * - * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret - * Url and vault id of the disk encryption key + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key * - * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault * Resource id of the KeyVault containing the key or secret * - * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url * pointing to a key or secret in KeyVault * - * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url - * and vault id of the key encryption key + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key * - * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault * Resource id of the KeyVault containing the key or secret * - * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] - * Resource Id + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id * - * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing - * to a key or secret in KeyVault + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault * - * @param {string} disk.location Resource location + * @param {string} snapshot.location Resource location * - * @param {object} [disk.tags] Resource tags + * @param {object} [snapshot.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -18030,101 +21561,100 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a disk. + * Creates or updates a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 * characters. * - * @param {object} disk Disk object supplied in the body of the Put disk - * operation. - * - * @param {object} [disk.sku] + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. * - * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {object} [snapshot.sku] * - * @param {array} [disk.zones] The Logical zone list for Disk. + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * - * @param {string} [disk.osType] The Operating System type. Possible values + * @param {string} [snapshot.osType] The Operating System type. Possible values * include: 'Windows', 'Linux' * - * @param {object} disk.creationData Disk source information. CreationData + * @param {object} snapshot.creationData Disk source information. CreationData * information cannot be changed after the disk has been created. * - * @param {string} disk.creationData.createOption This enumerates the possible - * sources of a disk's creation. Possible values include: 'Empty', 'Attach', - * 'FromImage', 'Import', 'Copy', 'Restore' + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' * - * @param {string} [disk.creationData.storageAccountId] If createOption is + * @param {string} [snapshot.creationData.storageAccountId] If createOption is * Import, the Azure Resource Manager identifier of the storage account * containing the blob to import as a disk. Required only if the blob is in a * different subscription * - * @param {object} [disk.creationData.imageReference] Disk source information. + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. * - * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Image Repository or user image reference. * - * @param {number} [disk.creationData.imageReference.lun] If the disk is + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of * the data disks in the image to use. For OS disks, this field is null. * - * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, * this is the URI of a blob to be imported into a managed disk. * - * @param {string} [disk.creationData.sourceResourceId] If createOption is + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is * Copy, this is the ARM id of the source snapshot or disk. * - * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, * this field is mandatory and it indicates the size of the VHD to create. If * this field is present for updates or creation with other options, it * indicates a resize. Resizes are only allowed if the disk is not attached to * a running VM, and can only increase the disk's size. * - * @param {object} [disk.encryptionSettings] Encryption settings for disk or - * snapshot + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot * - * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and - * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable * encryption. Set this flag to false and remove DiskEncryptionKey and * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the * request object, the existing settings remain unchanged. * - * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret - * Url and vault id of the disk encryption key + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key * - * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault * Resource id of the KeyVault containing the key or secret * - * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url * pointing to a key or secret in KeyVault * - * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url - * and vault id of the key encryption key + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key * - * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault * Resource id of the KeyVault containing the key or secret * - * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] - * Resource Id + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id * - * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing - * to a key or secret in KeyVault + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault * - * @param {string} disk.location Resource location + * @param {string} snapshot.location Resource location * - * @param {object} [disk.tags] Resource tags + * @param {object} [snapshot.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -18138,7 +21668,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {Disk} - The deserialized result object. + * @resolve {Snapshot} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18146,76 +21676,76 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Disk} [result] - The deserialized result object if an error did not occur. - * See {@link Disk} for more information. + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} for more information. * * {WebResource} [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, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates (patches) a disk. + * Updates (patches) a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 * characters. * - * @param {object} disk Disk object supplied in the body of the Patch disk - * operation. + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. * - * @param {string} [disk.osType] the Operating System type. Possible values + * @param {string} [snapshot.osType] the Operating System type. Possible values * include: 'Windows', 'Linux' * - * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, * this field is mandatory and it indicates the size of the VHD to create. If * this field is present for updates or creation with other options, it * indicates a resize. Resizes are only allowed if the disk is not attached to * a running VM, and can only increase the disk's size. * - * @param {object} [disk.encryptionSettings] Encryption settings for disk or - * snapshot + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot * - * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and - * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable * encryption. Set this flag to false and remove DiskEncryptionKey and * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the * request object, the existing settings remain unchanged. * - * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret - * Url and vault id of the disk encryption key + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key * - * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault * Resource id of the KeyVault containing the key or secret * - * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url * pointing to a key or secret in KeyVault * - * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url - * and vault id of the key encryption key + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key * - * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault * Resource id of the KeyVault containing the key or secret * - * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] - * Resource Id + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id * - * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing - * to a key or secret in KeyVault + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault * - * @param {object} [disk.tags] Resource tags + * @param {object} [snapshot.tags] Resource tags * - * @param {object} [disk.sku] + * @param {object} [snapshot.sku] * - * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -18224,70 +21754,70 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates (patches) a disk. + * Updates (patches) a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 * characters. * - * @param {object} disk Disk object supplied in the body of the Patch disk - * operation. + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. * - * @param {string} [disk.osType] the Operating System type. Possible values + * @param {string} [snapshot.osType] the Operating System type. Possible values * include: 'Windows', 'Linux' * - * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, * this field is mandatory and it indicates the size of the VHD to create. If * this field is present for updates or creation with other options, it * indicates a resize. Resizes are only allowed if the disk is not attached to * a running VM, and can only increase the disk's size. * - * @param {object} [disk.encryptionSettings] Encryption settings for disk or - * snapshot + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot * - * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and - * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable * encryption. Set this flag to false and remove DiskEncryptionKey and * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the * request object, the existing settings remain unchanged. * - * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret - * Url and vault id of the disk encryption key + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key * - * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault * Resource id of the KeyVault containing the key or secret * - * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url * pointing to a key or secret in KeyVault * - * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url - * and vault id of the key encryption key + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key * - * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault * Resource id of the KeyVault containing the key or secret * - * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] - * Resource Id + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id * - * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing - * to a key or secret in KeyVault + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault * - * @param {object} [disk.tags] Resource tags + * @param {object} [snapshot.tags] Resource tags * - * @param {object} [disk.sku] + * @param {object} [snapshot.sku] * - * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -18301,7 +21831,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {Disk} - The deserialized result object. + * @resolve {Snapshot} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18309,26 +21839,26 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Disk} [result] - The deserialized result object if an error did not occur. - * See {@link Disk} for more information. + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} for more information. * * {WebResource} [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, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about a disk. + * Deletes a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 * characters. * * @param {object} [options] Optional Parameters. @@ -18338,20 +21868,20 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about a disk. + * Deletes a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 * characters. * * @param {object} [options] Optional Parameters. @@ -18366,7 +21896,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {Disk} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18374,28 +21904,36 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Disk} [result] - The deserialized result object if an error did not occur. - * See {@link Disk} for more information. + * {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. */ - get(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a disk. + * Grants access to a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 * characters. * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18403,22 +21941,31 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginGrantAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a disk. + * Grants access to a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 * characters. * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18431,7 +21978,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {AccessUri} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18439,24 +21986,28 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {AccessUri} [result] - The deserialized result object if an error did not occur. + * See {@link AccessUri} for more information. * * {WebResource} [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, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; + beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all the disks under a resource group. + * Revokes access to a snapshot. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18464,67 +22015,21 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRevokeAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all the disks under a resource group. + * Revokes access to a snapshot. * * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DiskList} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DiskList} [result] - The deserialized result object if an error did not occur. - * See {@link DiskList} for more information. - * - * {WebResource} [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; - - - /** - * Lists all the disks under 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>; - - /** - * Lists all the disks under a subscription. + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. * * @param {object} [options] Optional Parameters. * @@ -18538,7 +22043,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {DiskList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18546,36 +22051,22 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DiskList} [result] - The deserialized result object if an error did not occur. - * See {@link DiskList} for more information. + * {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. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRevokeAccess(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRevokeAccess(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + beginRevokeAccess(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Grants access to a disk. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. - * - * @param {object} grantAccessData Access data object supplied in the body of - * the get disk access operation. - * - * @param {string} grantAccessData.access Possible values include: 'None', - * 'Read' + * Lists snapshots under a resource group. * - * @param {number} grantAccessData.durationInSeconds Time duration in seconds - * until the SAS access expires. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -18584,30 +22075,17 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - grantAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Grants access to a disk. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. - * - * @param {object} grantAccessData Access data object supplied in the body of - * the get disk access operation. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} grantAccessData.access Possible values include: 'None', - * 'Read' + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists snapshots under a resource group. * - * @param {number} grantAccessData.durationInSeconds Time duration in seconds - * until the SAS access expires. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -18621,7 +22099,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {AccessUri} - The deserialized result object. + * @resolve {SnapshotList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18629,27 +22107,23 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AccessUri} [result] - The deserialized result object if an error did not occur. - * See {@link AccessUri} for more information. + * {SnapshotList} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; - grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Revokes access to a disk. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists snapshots under a subscription. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -18658,21 +22132,17 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - revokeAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Revokes access to a disk. - * - * @param {string} resourceGroupName The name of the resource group. + * Lists snapshots under a subscription. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -18686,7 +22156,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {SnapshotList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18694,108 +22164,47 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {SnapshotList} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - revokeAccess(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - revokeAccess(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; - revokeAccess(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * Galleries + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Galleries { /** - * Creates or updates a disk. + * Create or update a Shared Image Gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. - * - * @param {object} disk Disk object supplied in the body of the Put disk - * operation. - * - * @param {object} [disk.sku] - * - * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' - * - * @param {array} [disk.zones] The Logical zone list for Disk. - * - * @param {string} [disk.osType] The Operating System type. Possible values - * include: 'Windows', 'Linux' - * - * @param {object} disk.creationData Disk source information. CreationData - * information cannot be changed after the disk has been created. - * - * @param {string} disk.creationData.createOption This enumerates the possible - * sources of a disk's creation. Possible values include: 'Empty', 'Attach', - * 'FromImage', 'Import', 'Copy', 'Restore' - * - * @param {string} [disk.creationData.storageAccountId] If createOption is - * Import, the Azure Resource Manager identifier of the storage account - * containing the blob to import as a disk. Required only if the blob is in a - * different subscription - * - * @param {object} [disk.creationData.imageReference] Disk source information. - * - * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. - * - * @param {number} [disk.creationData.imageReference.lun] If the disk is - * created from an image's data disk, this is an index that indicates which of - * the data disks in the image to use. For OS disks, this field is null. - * - * @param {string} [disk.creationData.sourceUri] If createOption is Import, - * this is the URI of a blob to be imported into a managed disk. - * - * @param {string} [disk.creationData.sourceResourceId] If createOption is - * Copy, this is the ARM id of the source snapshot or disk. - * - * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. - * - * @param {object} [disk.encryptionSettings] Encryption settings for disk or - * snapshot - * - * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and - * provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. - * - * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret - * Url and vault id of the disk encryption key - * - * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url - * and vault id of the key encryption key + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. * - * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. * - * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] - * Resource Id + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. * - * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing - * to a key or secret in KeyVault + * @param {object} [gallery.identifier] * - * @param {string} disk.location Resource location + * @param {string} gallery.location Resource location * - * @param {object} [disk.tags] Resource tags + * @param {object} [gallery.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -18804,101 +22213,32 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, galleryName: string, gallery: models.Gallery, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a disk. + * Create or update a Shared Image Gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. - * - * @param {object} disk Disk object supplied in the body of the Put disk - * operation. - * - * @param {object} [disk.sku] - * - * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' - * - * @param {array} [disk.zones] The Logical zone list for Disk. - * - * @param {string} [disk.osType] The Operating System type. Possible values - * include: 'Windows', 'Linux' - * - * @param {object} disk.creationData Disk source information. CreationData - * information cannot be changed after the disk has been created. - * - * @param {string} disk.creationData.createOption This enumerates the possible - * sources of a disk's creation. Possible values include: 'Empty', 'Attach', - * 'FromImage', 'Import', 'Copy', 'Restore' - * - * @param {string} [disk.creationData.storageAccountId] If createOption is - * Import, the Azure Resource Manager identifier of the storage account - * containing the blob to import as a disk. Required only if the blob is in a - * different subscription - * - * @param {object} [disk.creationData.imageReference] Disk source information. - * - * @param {string} disk.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. - * - * @param {number} [disk.creationData.imageReference.lun] If the disk is - * created from an image's data disk, this is an index that indicates which of - * the data disks in the image to use. For OS disks, this field is null. - * - * @param {string} [disk.creationData.sourceUri] If createOption is Import, - * this is the URI of a blob to be imported into a managed disk. - * - * @param {string} [disk.creationData.sourceResourceId] If createOption is - * Copy, this is the ARM id of the source snapshot or disk. - * - * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. - * - * @param {object} [disk.encryptionSettings] Encryption settings for disk or - * snapshot - * - * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and - * provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. - * - * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret - * Url and vault id of the disk encryption key - * - * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url - * and vault id of the key encryption key + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. * - * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. * - * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] - * Resource Id + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. * - * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing - * to a key or secret in KeyVault + * @param {object} [gallery.identifier] * - * @param {string} disk.location Resource location + * @param {string} gallery.location Resource location * - * @param {object} [disk.tags] Resource tags + * @param {object} [gallery.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -18912,7 +22252,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {Disk} - The deserialized result object. + * @resolve {Gallery} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18920,76 +22260,84 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Disk} [result] - The deserialized result object if an error did not occur. - * See {@link Disk} for more information. + * {Gallery} [result] - The deserialized result object if an error did not occur. + * See {@link Gallery} for more information. * * {WebResource} [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, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, galleryName: string, gallery: models.Gallery, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, galleryName: string, gallery: models.Gallery, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, galleryName: string, gallery: models.Gallery, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates (patches) a disk. + * Retrieves information about a Shared Image Gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery. * - * @param {object} disk Disk object supplied in the body of the Patch disk - * operation. + * @param {object} [options] Optional Parameters. * - * @param {string} [disk.osType] the Operating System type. Possible values - * include: 'Windows', 'Linux' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, galleryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [disk.encryptionSettings] Encryption settings for disk or - * snapshot + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and - * provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret - * Url and vault id of the disk encryption key + * {Promise} A promise is returned. * - * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @resolve {Gallery} - The deserialized result object. * - * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault + * @reject {Error|ServiceError} - The error object. * - * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url - * and vault id of the key encryption key + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] - * Resource Id + * {Gallery} [result] - The deserialized result object if an error did not occur. + * See {@link Gallery} for more information. * - * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing - * to a key or secret in KeyVault + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [disk.tags] Resource tags + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, galleryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, galleryName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, galleryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Delete a Shared Image Gallery. * - * @param {object} [disk.sku] + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. * * @param {object} [options] Optional Parameters. * @@ -18998,70 +22346,73 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, galleryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates (patches) a disk. + * Delete a Shared Image Gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. * - * @param {object} disk Disk object supplied in the body of the Patch disk - * operation. + * @param {object} [options] Optional Parameters. * - * @param {string} [disk.osType] the Operating System type. Possible values - * include: 'Windows', 'Linux' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [disk.encryptionSettings] Encryption settings for disk or - * snapshot + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and - * provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. + * {Promise} A promise is returned. * - * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret - * Url and vault id of the disk encryption key + * @resolve {null} - The deserialized result object. * - * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @reject {Error|ServiceError} - The error object. * - * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url - * and vault id of the key encryption key + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] - * Resource Id + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing - * to a key or secret in KeyVault + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, galleryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, galleryName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, galleryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List galleries under a resource group. * - * @param {object} [disk.tags] Resource tags + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [disk.sku] + * @param {object} [options] Optional Parameters. * - * @param {string} [disk.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * List galleries under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. * * @param {object} [options] Optional Parameters. * @@ -19075,7 +22426,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {Disk} - The deserialized result object. + * @resolve {GalleryList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19083,27 +22434,20 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Disk} [result] - The deserialized result object if an error did not occur. - * See {@link Disk} for more information. + * {GalleryList} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Deletes a disk. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * List galleries under a subscription. * * @param {object} [options] Optional Parameters. * @@ -19112,21 +22456,14 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a disk. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * List galleries under a subscription. * * @param {object} [options] Optional Parameters. * @@ -19140,7 +22477,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {GalleryList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19148,37 +22485,38 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {GalleryList} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. * * {WebResource} [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, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Grants access to a disk. + * Create or update a Shared Image Gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. * - * @param {object} grantAccessData Access data object supplied in the body of - * the get disk access operation. + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. * - * @param {string} grantAccessData.access Possible values include: 'None', - * 'Read' + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. * - * @param {number} grantAccessData.durationInSeconds Time duration in seconds - * until the SAS access expires. + * @param {object} [gallery.identifier] + * + * @param {string} gallery.location Resource location + * + * @param {object} [gallery.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -19187,30 +22525,32 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGrantAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, galleryName: string, gallery: models.Gallery, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Grants access to a disk. + * Create or update a Shared Image Gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery. The + * allowed characters are alphabets and numbers with dots and periods allowed + * in the middle. The maximum length is 80 characters. * - * @param {object} grantAccessData Access data object supplied in the body of - * the get disk access operation. + * @param {object} gallery Parameters supplied to the create or update Shared + * Image Gallery operation. * - * @param {string} grantAccessData.access Possible values include: 'None', - * 'Read' + * @param {string} [gallery.description] The description of this Shared Image + * Gallery resource. This property is updateable. * - * @param {number} grantAccessData.durationInSeconds Time duration in seconds - * until the SAS access expires. + * @param {object} [gallery.identifier] + * + * @param {string} gallery.location Resource location + * + * @param {object} [gallery.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -19224,7 +22564,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {AccessUri} - The deserialized result object. + * @resolve {Gallery} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19232,27 +22572,25 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AccessUri} [result] - The deserialized result object if an error did not occur. - * See {@link AccessUri} for more information. + * {Gallery} [result] - The deserialized result object if an error did not occur. + * See {@link Gallery} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; - beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, gallery: models.Gallery, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, gallery: models.Gallery, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, gallery: models.Gallery, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Revokes access to a disk. + * Delete a Shared Image Gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. * * @param {object} [options] Optional Parameters. * @@ -19261,21 +22599,19 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRevokeAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, galleryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Revokes access to a disk. + * Delete a Shared Image Gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} diskName The name of the managed disk that is being created. - * The name can't be changed after the disk is created. Supported characters - * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery to be + * deleted. * * @param {object} [options] Optional Parameters. * @@ -19289,7 +22625,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19297,21 +22633,19 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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. */ - beginRevokeAccess(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRevokeAccess(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; - beginRevokeAccess(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, galleryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, galleryName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, galleryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all the disks under a resource group. + * List galleries under a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -19323,14 +22657,14 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all the disks under a resource group. + * List galleries under a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -19347,7 +22681,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {DiskList} - The deserialized result object. + * @resolve {GalleryList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19355,20 +22689,20 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DiskList} [result] - The deserialized result object if an error did not occur. - * See {@link DiskList} for more information. + * {GalleryList} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. * * {WebResource} [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; + 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; /** - * Lists all the disks under a subscription. + * List galleries under a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -19380,14 +22714,14 @@ export interface Disks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all the disks under a subscription. + * List galleries under a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -19404,7 +22738,7 @@ export interface Disks { * * {Promise} A promise is returned. * - * @resolve {DiskList} - The deserialized result object. + * @resolve {GalleryList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19412,115 +22746,104 @@ export interface Disks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DiskList} [result] - The deserialized result object if an error did not occur. - * See {@link DiskList} for more information. + * {GalleryList} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryList} for more information. * * {WebResource} [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; + 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 - * Snapshots + * GalleryImages * __NOTE__: An instance of this class is automatically created for an * instance of the ComputeManagementClient. */ -export interface Snapshots { +export interface GalleryImages { /** - * Creates or updates a snapshot. + * Create or update a gallery Image Definition. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 * characters. * - * @param {object} snapshot Snapshot object supplied in the body of the Put - * disk operation. + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. * - * @param {object} [snapshot.sku] + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. * - * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. * - * @param {string} [snapshot.osType] The Operating System type. Possible values - * include: 'Windows', 'Linux' + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. * - * @param {object} snapshot.creationData Disk source information. CreationData - * information cannot be changed after the disk has been created. + * @param {string} [galleryImage.releaseNoteUri] The release note uri. * - * @param {string} snapshot.creationData.createOption This enumerates the - * possible sources of a disk's creation. Possible values include: 'Empty', - * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

    Possible values are:

    **Windows**

    + * **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {string} [snapshot.creationData.storageAccountId] If createOption is - * Import, the Azure Resource Manager identifier of the storage account - * containing the blob to import as a disk. Required only if the blob is in a - * different subscription + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' * - * @param {object} [snapshot.creationData.imageReference] Disk source - * information. + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. * - * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * @param {object} galleryImage.identifier * - * @param {number} [snapshot.creationData.imageReference.lun] If the disk is - * created from an image's data disk, this is an index that indicates which of - * the data disks in the image to use. For OS disks, this field is null. + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. * - * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, - * this is the URI of a blob to be imported into a managed disk. + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. * - * @param {string} [snapshot.creationData.sourceResourceId] If createOption is - * Copy, this is the ARM id of the source snapshot or disk. + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. * - * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. + * @param {object} [galleryImage.recommended] * - * @param {object} [snapshot.encryptionSettings] Encryption settings for disk - * or snapshot + * @param {object} [galleryImage.recommended.vCPUs] * - * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true - * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. + * @param {object} [galleryImage.recommended.memory] * - * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault - * Secret Url and vault id of the disk encryption key + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. * - * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. * - * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault + * @param {object} [galleryImage.disallowed] * - * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key - * Url and vault id of the key encryption key + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] * - * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {string} [galleryImage.purchasePlan.name] The plan ID. * - * @param {string} - * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. * - * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url - * pointing to a key or secret in KeyVault + * @param {string} [galleryImage.purchasePlan.product] The product ID. * - * @param {string} snapshot.location Resource location + * @param {string} galleryImage.location Resource location * - * @param {object} [snapshot.tags] Resource tags + * @param {object} [galleryImage.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -19529,100 +22852,89 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: models.GalleryImage, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a snapshot. + * Create or update a gallery Image Definition. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 * characters. * - * @param {object} snapshot Snapshot object supplied in the body of the Put - * disk operation. + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. * - * @param {object} [snapshot.sku] + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. * - * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. * - * @param {string} [snapshot.osType] The Operating System type. Possible values - * include: 'Windows', 'Linux' + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. * - * @param {object} snapshot.creationData Disk source information. CreationData - * information cannot be changed after the disk has been created. + * @param {string} [galleryImage.releaseNoteUri] The release note uri. * - * @param {string} snapshot.creationData.createOption This enumerates the - * possible sources of a disk's creation. Possible values include: 'Empty', - * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

    Possible values are:

    **Windows**

    + * **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {string} [snapshot.creationData.storageAccountId] If createOption is - * Import, the Azure Resource Manager identifier of the storage account - * containing the blob to import as a disk. Required only if the blob is in a - * different subscription + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' * - * @param {object} [snapshot.creationData.imageReference] Disk source - * information. + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. * - * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * @param {object} galleryImage.identifier * - * @param {number} [snapshot.creationData.imageReference.lun] If the disk is - * created from an image's data disk, this is an index that indicates which of - * the data disks in the image to use. For OS disks, this field is null. + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. * - * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, - * this is the URI of a blob to be imported into a managed disk. + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. * - * @param {string} [snapshot.creationData.sourceResourceId] If createOption is - * Copy, this is the ARM id of the source snapshot or disk. + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. * - * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. + * @param {object} [galleryImage.recommended] * - * @param {object} [snapshot.encryptionSettings] Encryption settings for disk - * or snapshot + * @param {object} [galleryImage.recommended.vCPUs] * - * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true - * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. + * @param {object} [galleryImage.recommended.memory] * - * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault - * Secret Url and vault id of the disk encryption key + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. * - * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. * - * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault + * @param {object} [galleryImage.disallowed] * - * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key - * Url and vault id of the key encryption key + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. * - * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {object} [galleryImage.purchasePlan] * - * @param {string} - * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * @param {string} [galleryImage.purchasePlan.name] The plan ID. * - * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url - * pointing to a key or secret in KeyVault + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. * - * @param {string} snapshot.location Resource location + * @param {string} [galleryImage.purchasePlan.product] The product ID. * - * @param {object} [snapshot.tags] Resource tags + * @param {string} galleryImage.location Resource location + * + * @param {object} [galleryImage.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -19636,7 +22948,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {Snapshot} - The deserialized result object. + * @resolve {GalleryImage} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19644,76 +22956,28 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Snapshot} [result] - The deserialized result object if an error did not occur. - * See {@link Snapshot} for more information. + * {GalleryImage} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImage} for more information. * * {WebResource} [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, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: models.GalleryImage, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: models.GalleryImage, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: models.GalleryImage, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates (patches) a snapshot. + * Retrieves information about a gallery Image Definition. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} snapshot Snapshot object supplied in the body of the Patch - * snapshot operation. - * - * @param {string} [snapshot.osType] the Operating System type. Possible values - * include: 'Windows', 'Linux' - * - * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. - * - * @param {object} [snapshot.encryptionSettings] Encryption settings for disk - * or snapshot - * - * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true - * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. - * - * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault - * Secret Url and vault id of the disk encryption key - * - * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key - * Url and vault id of the key encryption key - * - * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} - * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * @param {string} galleryName The name of the Shared Image Gallery from which + * the Image Definitions are to be retrieved. * - * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [snapshot.tags] Resource tags - * - * @param {object} [snapshot.sku] - * - * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {string} galleryImageName The name of the gallery Image Definition to + * be retrieved. * * @param {object} [options] Optional Parameters. * @@ -19722,70 +22986,22 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates (patches) a snapshot. + * Retrieves information about a gallery Image Definition. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} snapshot Snapshot object supplied in the body of the Patch - * snapshot operation. - * - * @param {string} [snapshot.osType] the Operating System type. Possible values - * include: 'Windows', 'Linux' - * - * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. - * - * @param {object} [snapshot.encryptionSettings] Encryption settings for disk - * or snapshot - * - * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true - * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. - * - * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault - * Secret Url and vault id of the disk encryption key - * - * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key - * Url and vault id of the key encryption key - * - * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} - * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id - * - * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [snapshot.tags] Resource tags - * - * @param {object} [snapshot.sku] + * @param {string} galleryName The name of the Shared Image Gallery from which + * the Image Definitions are to be retrieved. * - * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {string} galleryImageName The name of the gallery Image Definition to + * be retrieved. * * @param {object} [options] Optional Parameters. * @@ -19799,7 +23015,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {Snapshot} - The deserialized result object. + * @resolve {GalleryImage} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19807,27 +23023,28 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Snapshot} [result] - The deserialized result object if an error did not occur. - * See {@link Snapshot} for more information. + * {GalleryImage} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImage} for more information. * * {WebResource} [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, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, galleryName: string, galleryImageName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, galleryName: string, galleryImageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about a snapshot. + * Delete a gallery image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. * * @param {object} [options] Optional Parameters. * @@ -19836,21 +23053,22 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about a snapshot. + * Delete a gallery image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. * * @param {object} [options] Optional Parameters. * @@ -19864,7 +23082,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {Snapshot} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19872,27 +23090,24 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Snapshot} [result] - The deserialized result object if an error did not occur. - * See {@link Snapshot} for more information. + * {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. */ - get(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a snapshot. + * List gallery Image Definitions in a gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery from which + * Image Definitions are to be listed. * * @param {object} [options] Optional Parameters. * @@ -19901,21 +23116,19 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByGalleryWithHttpOperationResponse(resourceGroupName: string, galleryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a snapshot. + * List gallery Image Definitions in a gallery. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery from which + * Image Definitions are to be listed. * * @param {object} [options] Optional Parameters. * @@ -19929,7 +23142,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {GalleryImageList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19937,23 +23150,95 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {GalleryImageList} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageList} for more information. * * {WebResource} [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, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists snapshots under a resource group. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByGallery(resourceGroupName: string, galleryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByGallery(resourceGroupName: string, galleryName: string, callback: ServiceCallback): void; + listByGallery(resourceGroupName: string, galleryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or update a gallery Image Definition. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. + * + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. + * + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. + * + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. + * + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. + * + * @param {string} [galleryImage.releaseNoteUri] The release note uri. + * + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

    Possible values are:

    **Windows**

    + * **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' + * + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. + * + * @param {object} galleryImage.identifier + * + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. + * + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. + * + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. + * + * @param {object} [galleryImage.recommended] + * + * @param {object} [galleryImage.recommended.vCPUs] + * + * @param {object} [galleryImage.recommended.memory] + * + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. + * + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. + * + * @param {object} [galleryImage.disallowed] + * + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] + * + * @param {string} [galleryImage.purchasePlan.name] The plan ID. + * + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. + * + * @param {string} [galleryImage.purchasePlan.product] The product ID. + * + * @param {string} galleryImage.location Resource location * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [galleryImage.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -19962,67 +23247,89 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: models.GalleryImage, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists snapshots under a resource group. + * Create or update a gallery Image Definition. * * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options] Optional Parameters. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be created. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} galleryImageName The name of the gallery Image Definition to + * be created or updated. The allowed characters are alphabets and numbers with + * dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} galleryImage Parameters supplied to the create or update + * gallery image operation. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [galleryImage.description] The description of this gallery + * Image Definition resource. This property is updateable. * - * {Promise} A promise is returned. + * @param {string} [galleryImage.eula] The Eula agreement for the gallery Image + * Definition. * - * @resolve {SnapshotList} - The deserialized result object. + * @param {string} [galleryImage.privacyStatementUri] The privacy statement + * uri. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [galleryImage.releaseNoteUri] The release note uri. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} galleryImage.osType This property allows you to specify the + * type of the OS that is included in the disk when creating a VM from a + * managed image.

    Possible values are:

    **Windows**

    + * **Linux**. Possible values include: 'Windows', 'Linux' * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} galleryImage.osState The allowed values for OS State are + * 'Generalized'. Possible values include: 'Generalized', 'Specialized' * - * {SnapshotList} [result] - The deserialized result object if an error did not occur. - * See {@link SnapshotList} for more information. + * @param {date} [galleryImage.endOfLifeDate] The end of life date of the + * gallery Image Definition. This property can be used for decommissioning + * purposes. This property is updateable. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} galleryImage.identifier * - * {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; - - - /** - * Lists snapshots under a subscription. + * @param {string} galleryImage.identifier.publisher The name of the gallery + * Image Definition publisher. * - * @param {object} [options] Optional Parameters. + * @param {string} galleryImage.identifier.offer The name of the gallery Image + * Definition offer. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} galleryImage.identifier.sku The name of the gallery Image + * Definition SKU. * - * @returns {Promise} A promise is returned + * @param {object} [galleryImage.recommended] * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [galleryImage.recommended.vCPUs] * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists snapshots under a subscription. + * @param {object} [galleryImage.recommended.memory] + * + * @param {number} [galleryImage.recommended.memory.min] The minimum number of + * the resource. + * + * @param {number} [galleryImage.recommended.memory.max] The maximum number of + * the resource. + * + * @param {object} [galleryImage.disallowed] + * + * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types. + * + * @param {object} [galleryImage.purchasePlan] + * + * @param {string} [galleryImage.purchasePlan.name] The plan ID. + * + * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID. + * + * @param {string} [galleryImage.purchasePlan.product] The product ID. + * + * @param {string} galleryImage.location Resource location + * + * @param {object} [galleryImage.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -20036,7 +23343,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {SnapshotList} - The deserialized result object. + * @resolve {GalleryImage} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20044,36 +23351,28 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SnapshotList} [result] - The deserialized result object if an error did not occur. - * See {@link SnapshotList} for more information. + * {GalleryImage} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImage} for more information. * * {WebResource} [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; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: models.GalleryImage, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: models.GalleryImage, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: models.GalleryImage, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Grants access to a snapshot. + * Delete a gallery image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} grantAccessData Access data object supplied in the body of - * the get snapshot access operation. - * - * @param {string} grantAccessData.access Possible values include: 'None', - * 'Read' + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. * - * @param {number} grantAccessData.durationInSeconds Time duration in seconds - * until the SAS access expires. + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. * * @param {object} [options] Optional Parameters. * @@ -20082,30 +23381,22 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - grantAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Grants access to a snapshot. + * Delete a gallery image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} grantAccessData Access data object supplied in the body of - * the get snapshot access operation. - * - * @param {string} grantAccessData.access Possible values include: 'None', - * 'Read' + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition is to be deleted. * - * @param {number} grantAccessData.durationInSeconds Time duration in seconds - * until the SAS access expires. + * @param {string} galleryImageName The name of the gallery Image Definition to + * be deleted. * * @param {object} [options] Optional Parameters. * @@ -20119,7 +23410,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {AccessUri} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20127,27 +23418,22 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AccessUri} [result] - The deserialized result object if an error did not occur. - * See {@link AccessUri} for more information. + * {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. */ - grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; - grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Revokes access to a snapshot. - * - * @param {string} resourceGroupName The name of the resource group. + * List gallery Image Definitions in a gallery. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -20156,21 +23442,17 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - revokeAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByGalleryNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Revokes access to a snapshot. + * List gallery Image Definitions in a gallery. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -20184,7 +23466,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {GalleryImageList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20192,107 +23474,75 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {GalleryImageList} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - revokeAccess(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - revokeAccess(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; - revokeAccess(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByGalleryNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByGalleryNext(nextPageLink: string, callback: ServiceCallback): void; + listByGalleryNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * GalleryImageVersions + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface GalleryImageVersions { /** - * Creates or updates a snapshot. + * Create or update a gallery Image Version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} snapshot Snapshot object supplied in the body of the Put - * disk operation. - * - * @param {object} [snapshot.sku] - * - * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' - * - * @param {string} [snapshot.osType] The Operating System type. Possible values - * include: 'Windows', 'Linux' - * - * @param {object} snapshot.creationData Disk source information. CreationData - * information cannot be changed after the disk has been created. - * - * @param {string} snapshot.creationData.createOption This enumerates the - * possible sources of a disk's creation. Possible values include: 'Empty', - * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' - * - * @param {string} [snapshot.creationData.storageAccountId] If createOption is - * Import, the Azure Resource Manager identifier of the storage account - * containing the blob to import as a disk. Required only if the blob is in a - * different subscription - * - * @param {object} [snapshot.creationData.imageReference] Disk source - * information. - * - * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. - * - * @param {number} [snapshot.creationData.imageReference.lun] If the disk is - * created from an image's data disk, this is an index that indicates which of - * the data disks in the image to use. For OS disks, this field is null. - * - * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, - * this is the URI of a blob to be imported into a managed disk. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. * - * @param {string} [snapshot.creationData.sourceResourceId] If createOption is - * Copy, this is the ARM id of the source snapshot or disk. + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. * - * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. * - * @param {object} [snapshot.encryptionSettings] Encryption settings for disk - * or snapshot + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. * - * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true - * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. + * @param {object} galleryImageVersion.publishingProfile * - * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault - * Secret Url and vault id of the disk encryption key + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. * - * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. * - * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. * - * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key - * Url and vault id of the key encryption key + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. * - * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {object} galleryImageVersion.publishingProfile.source * - * @param {string} - * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * @param {object} galleryImageVersion.publishingProfile.source.managedImage * - * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url - * pointing to a key or secret in KeyVault + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. * - * @param {string} snapshot.location Resource location + * @param {string} galleryImageVersion.location Resource location * - * @param {object} [snapshot.tags] Resource tags + * @param {object} [galleryImageVersion.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -20301,100 +23551,60 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: models.GalleryImageVersion, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a snapshot. + * Create or update a gallery Image Version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} snapshot Snapshot object supplied in the body of the Put - * disk operation. - * - * @param {object} [snapshot.sku] - * - * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' - * - * @param {string} [snapshot.osType] The Operating System type. Possible values - * include: 'Windows', 'Linux' - * - * @param {object} snapshot.creationData Disk source information. CreationData - * information cannot be changed after the disk has been created. - * - * @param {string} snapshot.creationData.createOption This enumerates the - * possible sources of a disk's creation. Possible values include: 'Empty', - * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' - * - * @param {string} [snapshot.creationData.storageAccountId] If createOption is - * Import, the Azure Resource Manager identifier of the storage account - * containing the blob to import as a disk. Required only if the blob is in a - * different subscription - * - * @param {object} [snapshot.creationData.imageReference] Disk source - * information. - * - * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. - * - * @param {number} [snapshot.creationData.imageReference.lun] If the disk is - * created from an image's data disk, this is an index that indicates which of - * the data disks in the image to use. For OS disks, this field is null. - * - * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, - * this is the URI of a blob to be imported into a managed disk. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. * - * @param {string} [snapshot.creationData.sourceResourceId] If createOption is - * Copy, this is the ARM id of the source snapshot or disk. + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. * - * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. * - * @param {object} [snapshot.encryptionSettings] Encryption settings for disk - * or snapshot + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. * - * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true - * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. + * @param {object} galleryImageVersion.publishingProfile * - * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault - * Secret Url and vault id of the disk encryption key + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. * - * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. * - * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. * - * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key - * Url and vault id of the key encryption key + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. * - * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret + * @param {object} galleryImageVersion.publishingProfile.source * - * @param {string} - * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * @param {object} galleryImageVersion.publishingProfile.source.managedImage * - * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url - * pointing to a key or secret in KeyVault + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. * - * @param {string} snapshot.location Resource location + * @param {string} galleryImageVersion.location Resource location * - * @param {object} [snapshot.tags] Resource tags + * @param {object} [galleryImageVersion.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -20408,7 +23618,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {Snapshot} - The deserialized result object. + * @resolve {GalleryImageVersion} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20416,151 +23626,67 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Snapshot} [result] - The deserialized result object if an error did not occur. - * See {@link Snapshot} for more information. + * {GalleryImageVersion} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersion} for more information. * * {WebResource} [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, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: models.GalleryImageVersion, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: models.GalleryImageVersion, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: models.GalleryImageVersion, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates (patches) a snapshot. + * Retrieves information about a gallery Image Version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} snapshot Snapshot object supplied in the body of the Patch - * snapshot operation. - * - * @param {string} [snapshot.osType] the Operating System type. Possible values - * include: 'Windows', 'Linux' - * - * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. - * - * @param {object} [snapshot.encryptionSettings] Encryption settings for disk - * or snapshot - * - * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true - * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. - * - * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault - * Secret Url and vault id of the disk encryption key - * - * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key - * Url and vault id of the key encryption key - * - * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} - * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id - * - * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [snapshot.tags] Resource tags + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. * - * @param {object} [snapshot.sku] + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. * - * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'ReplicationStatus' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates (patches) a snapshot. + * Retrieves information about a gallery Image Version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} snapshot Snapshot object supplied in the body of the Patch - * snapshot operation. - * - * @param {string} [snapshot.osType] the Operating System type. Possible values - * include: 'Windows', 'Linux' - * - * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, - * this field is mandatory and it indicates the size of the VHD to create. If - * this field is present for updates or creation with other options, it - * indicates a resize. Resizes are only allowed if the disk is not attached to - * a running VM, and can only increase the disk's size. - * - * @param {object} [snapshot.encryptionSettings] Encryption settings for disk - * or snapshot - * - * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true - * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable - * encryption. Set this flag to false and remove DiskEncryptionKey and - * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the - * request object, the existing settings remain unchanged. - * - * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault - * Secret Url and vault id of the disk encryption key - * - * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key - * Url and vault id of the key encryption key - * - * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault - * Resource id of the KeyVault containing the key or secret - * - * @param {string} - * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id - * - * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url - * pointing to a key or secret in KeyVault - * - * @param {object} [snapshot.tags] Resource tags + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. * - * @param {object} [snapshot.sku] + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. * - * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'ReplicationStatus' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -20571,7 +23697,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {Snapshot} - The deserialized result object. + * @resolve {GalleryImageVersion} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20579,27 +23705,31 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Snapshot} [result] - The deserialized result object if an error did not occur. - * See {@link Snapshot} for more information. + * {GalleryImageVersion} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersion} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a snapshot. + * Delete a gallery Image Version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. * * @param {object} [options] Optional Parameters. * @@ -20608,21 +23738,25 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a snapshot. + * Delete a gallery Image Version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. * * @param {object} [options] Optional Parameters. * @@ -20636,7 +23770,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20644,37 +23778,27 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {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, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Grants access to a snapshot. + * List gallery Image Versions in a gallery Image Definition. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} grantAccessData Access data object supplied in the body of - * the get snapshot access operation. - * - * @param {string} grantAccessData.access Possible values include: 'None', - * 'Read' + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. * - * @param {number} grantAccessData.durationInSeconds Time duration in seconds - * until the SAS access expires. + * @param {string} galleryImageName The name of the Shared Image Gallery Image + * Definition from which the Image Versions are to be listed. * * @param {object} [options] Optional Parameters. * @@ -20683,30 +23807,22 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginGrantAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByGalleryImageWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Grants access to a snapshot. + * List gallery Image Versions in a gallery Image Definition. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. - * - * @param {object} grantAccessData Access data object supplied in the body of - * the get snapshot access operation. - * - * @param {string} grantAccessData.access Possible values include: 'None', - * 'Read' + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. * - * @param {number} grantAccessData.durationInSeconds Time duration in seconds - * until the SAS access expires. + * @param {string} galleryImageName The name of the Shared Image Gallery Image + * Definition from which the Image Versions are to be listed. * * @param {object} [options] Optional Parameters. * @@ -20720,7 +23836,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {AccessUri} - The deserialized result object. + * @resolve {GalleryImageVersionList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20728,27 +23844,67 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AccessUri} [result] - The deserialized result object if an error did not occur. - * See {@link AccessUri} for more information. + * {GalleryImageVersionList} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersionList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; - beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByGalleryImage(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByGalleryImage(resourceGroupName: string, galleryName: string, galleryImageName: string, callback: ServiceCallback): void; + listByGalleryImage(resourceGroupName: string, galleryName: string, galleryImageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Revokes access to a snapshot. + * Create or update a gallery Image Version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. + * + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. + * + * @param {object} galleryImageVersion.publishingProfile + * + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. + * + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. + * + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. + * + * @param {object} galleryImageVersion.publishingProfile.source + * + * @param {object} galleryImageVersion.publishingProfile.source.managedImage + * + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. + * + * @param {string} galleryImageVersion.location Resource location + * + * @param {object} [galleryImageVersion.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -20757,21 +23913,60 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRevokeAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: models.GalleryImageVersion, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Revokes access to a snapshot. + * Create or update a gallery Image Version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} snapshotName The name of the snapshot that is being created. - * The name can't be changed after the snapshot is created. Supported - * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 - * characters. + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version is to be created. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be created. Needs to follow semantic version name pattern: The + * allowed characters are digit and period. Digits must be within the range of + * a 32-bit integer. Format: .. + * + * @param {object} galleryImageVersion Parameters supplied to the create or + * update gallery Image Version operation. + * + * @param {object} galleryImageVersion.publishingProfile + * + * @param {number} [galleryImageVersion.publishingProfile.replicaCount] The + * number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not + * specified. This property is updateable. + * + * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest] + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end + * of life date of the gallery Image Version. This property can be used for + * decommissioning purposes. This property is updateable. + * + * @param {array} [galleryImageVersion.publishingProfile.targetRegions] The + * target regions where the Image Version is going to be replicated to. This + * property is updateable. + * + * @param {object} galleryImageVersion.publishingProfile.source + * + * @param {object} galleryImageVersion.publishingProfile.source.managedImage + * + * @param {string} galleryImageVersion.publishingProfile.source.managedImage.id + * The managed artifact id. + * + * @param {string} galleryImageVersion.location Resource location + * + * @param {object} [galleryImageVersion.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -20785,7 +23980,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {GalleryImageVersion} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20793,24 +23988,31 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {GalleryImageVersion} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersion} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRevokeAccess(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRevokeAccess(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; - beginRevokeAccess(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: models.GalleryImageVersion, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: models.GalleryImageVersion, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: models.GalleryImageVersion, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists snapshots under a resource group. + * Delete a gallery Image Version. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. * * @param {object} [options] Optional Parameters. * @@ -20819,17 +24021,25 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists snapshots under a resource group. + * Delete a gallery Image Version. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} galleryName The name of the Shared Image Gallery in which + * the Image Definition resides. + * + * @param {string} galleryImageName The name of the gallery Image Definition in + * which the Image Version resides. + * + * @param {string} galleryImageVersionName The name of the gallery Image + * Version to be deleted. * * @param {object} [options] Optional Parameters. * @@ -20843,7 +24053,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {SnapshotList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20851,20 +24061,19 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SnapshotList} [result] - The deserialized result object if an error did not occur. - * See {@link SnapshotList} for more information. + * {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. */ - 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; + beginDeleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists snapshots under a subscription. + * List gallery Image Versions in a gallery Image Definition. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -20876,14 +24085,14 @@ export interface Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByGalleryImageNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists snapshots under a subscription. + * List gallery Image Versions in a gallery Image Definition. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -20900,7 +24109,7 @@ export interface Snapshots { * * {Promise} A promise is returned. * - * @resolve {SnapshotList} - The deserialized result object. + * @resolve {GalleryImageVersionList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20908,16 +24117,17 @@ export interface Snapshots { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SnapshotList} [result] - The deserialized result object if an error did not occur. - * See {@link SnapshotList} for more information. + * {GalleryImageVersionList} [result] - The deserialized result object if an error did not occur. + * See {@link GalleryImageVersionList} for more + * information. * * {WebResource} [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; + listByGalleryImageNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByGalleryImageNext(nextPageLink: string, callback: ServiceCallback): void; + listByGalleryImageNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** diff --git a/lib/services/computeManagement2/lib/operations/index.js b/lib/services/computeManagement2/lib/operations/index.js index c6c01da729..b421d91e13 100644 --- a/lib/services/computeManagement2/lib/operations/index.js +++ b/lib/services/computeManagement2/lib/operations/index.js @@ -18,9 +18,9 @@ exports.Operations = require('./operations'); exports.AvailabilitySets = require('./availabilitySets'); exports.VirtualMachineExtensionImages = require('./virtualMachineExtensionImages'); exports.VirtualMachineExtensions = require('./virtualMachineExtensions'); -exports.VirtualMachines = require('./virtualMachines'); exports.VirtualMachineImages = require('./virtualMachineImages'); exports.UsageOperations = require('./usageOperations'); +exports.VirtualMachines = require('./virtualMachines'); exports.VirtualMachineSizes = require('./virtualMachineSizes'); exports.Images = require('./images'); exports.VirtualMachineScaleSets = require('./virtualMachineScaleSets'); @@ -32,4 +32,7 @@ exports.VirtualMachineRunCommands = require('./virtualMachineRunCommands'); exports.ResourceSkus = require('./resourceSkus'); exports.Disks = require('./disks'); exports.Snapshots = require('./snapshots'); +exports.Galleries = require('./galleries'); +exports.GalleryImages = require('./galleryImages'); +exports.GalleryImageVersions = require('./galleryImageVersions'); exports.ContainerServices = require('./containerServices'); diff --git a/lib/services/computeManagement2/lib/operations/logAnalytics.js b/lib/services/computeManagement2/lib/operations/logAnalytics.js index 8fa32eb27b..73ce657a69 100644 --- a/lib/services/computeManagement2/lib/operations/logAnalytics.js +++ b/lib/services/computeManagement2/lib/operations/logAnalytics.js @@ -273,7 +273,7 @@ function _beginExportRequestRateByInterval(parameters, location, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -455,7 +455,7 @@ function _beginExportThrottledRequests(parameters, location, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/computeManagement2/lib/operations/operations.js b/lib/services/computeManagement2/lib/operations/operations.js index bdb52b2e71..1973a817af 100644 --- a/lib/services/computeManagement2/lib/operations/operations.js +++ b/lib/services/computeManagement2/lib/operations/operations.js @@ -46,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { diff --git a/lib/services/computeManagement2/lib/operations/snapshots.js b/lib/services/computeManagement2/lib/operations/snapshots.js index 0bc6378ffd..499e46f8d1 100644 --- a/lib/services/computeManagement2/lib/operations/snapshots.js +++ b/lib/services/computeManagement2/lib/operations/snapshots.js @@ -52,7 +52,7 @@ const WebResource = msRest.WebResource; * information. * * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [snapshot.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -232,7 +232,7 @@ function _createOrUpdate(resourceGroupName, snapshotName, snapshot, options, cal * @param {object} [snapshot.sku] * * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -342,7 +342,7 @@ function _get(resourceGroupName, snapshotName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -472,9 +472,7 @@ function _get(resourceGroupName, snapshotName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -512,20 +510,6 @@ function _deleteMethod(resourceGroupName, snapshotName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -565,7 +549,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -700,7 +684,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -912,9 +896,7 @@ function _grantAccess(resourceGroupName, snapshotName, grantAccessData, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -952,20 +934,6 @@ function _revokeAccess(resourceGroupName, snapshotName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1009,7 +977,7 @@ function _revokeAccess(resourceGroupName, snapshotName, options, callback) { * information. * * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [snapshot.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -1089,7 +1057,7 @@ function _beginCreateOrUpdate(resourceGroupName, snapshotName, snapshot, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1288,7 +1256,7 @@ function _beginCreateOrUpdate(resourceGroupName, snapshotName, snapshot, options * @param {object} [snapshot.sku] * * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -1318,7 +1286,7 @@ function _beginUpdate(resourceGroupName, snapshotName, snapshot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1481,9 +1449,7 @@ function _beginUpdate(resourceGroupName, snapshotName, snapshot, options, callba * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1499,7 +1465,7 @@ function _beginDeleteMethod(resourceGroupName, snapshotName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1585,23 +1551,6 @@ function _beginDeleteMethod(resourceGroupName, snapshotName, options, callback) // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -1654,7 +1603,7 @@ function _beginGrantAccess(resourceGroupName, snapshotName, grantAccessData, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1800,9 +1749,7 @@ function _beginGrantAccess(resourceGroupName, snapshotName, grantAccessData, opt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1818,7 +1765,7 @@ function _beginRevokeAccess(resourceGroupName, snapshotName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-04-01'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1904,23 +1851,6 @@ function _beginRevokeAccess(resourceGroupName, snapshotName, options, callback) // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -2242,7 +2172,7 @@ class Snapshots { * information. * * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [snapshot.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -2356,7 +2286,7 @@ class Snapshots { * information. * * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [snapshot.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -2512,7 +2442,7 @@ class Snapshots { * @param {object} [snapshot.sku] * * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -2596,7 +2526,7 @@ class Snapshots { * @param {object} [snapshot.sku] * * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -2754,7 +2684,7 @@ class Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2794,7 +2724,7 @@ class Snapshots { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2802,9 +2732,7 @@ class Snapshots { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3117,7 +3045,7 @@ class Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3157,7 +3085,7 @@ class Snapshots { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3165,9 +3093,7 @@ class Snapshots { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3230,7 +3156,7 @@ class Snapshots { * information. * * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [snapshot.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -3344,7 +3270,7 @@ class Snapshots { * information. * * @param {string} snapshot.creationData.imageReference.id A relative uri - * containing either a Platform Imgage Repository or user image reference. + * containing either a Platform Image Repository or user image reference. * * @param {number} [snapshot.creationData.imageReference.lun] If the disk is * created from an image's data disk, this is an index that indicates which of @@ -3500,7 +3426,7 @@ class Snapshots { * @param {object} [snapshot.sku] * * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -3584,7 +3510,7 @@ class Snapshots { * @param {object} [snapshot.sku] * * @param {string} [snapshot.sku.name] The sku name. Possible values include: - * 'Standard_LRS', 'Premium_LRS' + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' * * @param {object} [options] Optional Parameters. * @@ -3650,7 +3576,7 @@ class Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3690,7 +3616,7 @@ class Snapshots { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3698,9 +3624,7 @@ class Snapshots { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3853,7 +3777,7 @@ class Snapshots { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3893,7 +3817,7 @@ class Snapshots { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3901,9 +3825,7 @@ class Snapshots { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/computeManagement2/lib/operations/usageOperations.js b/lib/services/computeManagement2/lib/operations/usageOperations.js index a6a356e1f3..7feda277bf 100644 --- a/lib/services/computeManagement2/lib/operations/usageOperations.js +++ b/lib/services/computeManagement2/lib/operations/usageOperations.js @@ -49,7 +49,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineExtensionImages.js b/lib/services/computeManagement2/lib/operations/virtualMachineExtensionImages.js index fc9e07d629..d43c3310bc 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineExtensionImages.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineExtensionImages.js @@ -54,7 +54,7 @@ function _get(location, publisherName, type, version, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -204,7 +204,7 @@ function _listTypes(location, publisherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -371,7 +371,7 @@ function _listVersions(location, publisherName, type, options, callback) { let filter = (options && options.filter !== undefined) ? options.filter : undefined; let top = (options && options.top !== undefined) ? options.top : undefined; let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js b/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js index 669cd7f9c8..4f94980f57 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js @@ -280,9 +280,7 @@ function _update(resourceGroupName, vmName, vmExtensionName, extensionParameters * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -320,20 +318,6 @@ function _deleteMethod(resourceGroupName, vmName, vmExtensionName, options, call 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -383,7 +367,7 @@ function _get(resourceGroupName, vmName, vmExtensionName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -501,6 +485,161 @@ function _get(resourceGroupName, vmName, vmExtensionName, options, callback) { }); } +/** + * The operation to get all extensions of a Virtual Machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtensionsListResult} for more + * information. + * + * {object} [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(resourceGroupName, vmName, options, callback) { + /* jshint 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-10-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineExtensionsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * The operation to create or update the extension. * @@ -590,7 +729,7 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extens if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -805,7 +944,7 @@ function _beginUpdate(resourceGroupName, vmName, vmExtensionName, extensionParam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -955,9 +1094,7 @@ function _beginUpdate(resourceGroupName, vmName, vmExtensionName, extensionParam * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -973,7 +1110,7 @@ function _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1063,23 +1200,6 @@ function _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -1097,6 +1217,7 @@ class VirtualMachineExtensions { this._update = _update; this._deleteMethod = _deleteMethod; this._get = _get; + this._list = _list; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginUpdate = _beginUpdate; this._beginDeleteMethod = _beginDeleteMethod; @@ -1465,7 +1586,7 @@ class VirtualMachineExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1505,7 +1626,7 @@ class VirtualMachineExtensions { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1513,9 +1634,7 @@ class VirtualMachineExtensions { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1640,6 +1759,101 @@ class VirtualMachineExtensions { } } + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers 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(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineExtensionsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtensionsListResult} for more + * information. + * + * {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(resourceGroupName, vmName, options, optionalCallback) { + 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(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, vmName, options, optionalCallback); + } + } + /** * The operation to create or update the extension. * @@ -2003,7 +2217,7 @@ class VirtualMachineExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2043,7 +2257,7 @@ class VirtualMachineExtensions { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2051,9 +2265,7 @@ class VirtualMachineExtensions { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineImages.js b/lib/services/computeManagement2/lib/operations/virtualMachineImages.js index 236d37b95f..d6de033cc5 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineImages.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineImages.js @@ -55,7 +55,7 @@ function _get(location, publisherName, offer, skus, version, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -223,7 +223,7 @@ function _list(location, publisherName, offer, skus, options, callback) { let filter = (options && options.filter !== undefined) ? options.filter : undefined; let top = (options && options.top !== undefined) ? options.top : undefined; let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -406,7 +406,7 @@ function _listOffers(location, publisherName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -561,7 +561,7 @@ function _listPublishers(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -716,7 +716,7 @@ function _listSkus(location, publisherName, offer, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineRunCommands.js b/lib/services/computeManagement2/lib/operations/virtualMachineRunCommands.js index b5a3b434bb..fa558c0e84 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineRunCommands.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineRunCommands.js @@ -47,7 +47,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -192,7 +192,7 @@ function _get(location, commandId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetExtensions.js b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetExtensions.js index 591b99d1ab..0904d03501 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetExtensions.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetExtensions.js @@ -148,9 +148,7 @@ function _createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, e * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -188,20 +186,6 @@ function _deleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, opt 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -251,7 +235,7 @@ function _get(resourceGroupName, vmScaleSetName, vmssExtensionName, options, cal throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -406,7 +390,7 @@ function _list(resourceGroupName, vmScaleSetName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -583,7 +567,7 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -750,9 +734,7 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionNa * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -768,7 +750,7 @@ function _beginDeleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -858,23 +840,6 @@ function _beginDeleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -1195,7 +1160,7 @@ class VirtualMachineScaleSetExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1235,7 +1200,7 @@ class VirtualMachineScaleSetExtensions { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1243,9 +1208,7 @@ class VirtualMachineScaleSetExtensions { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1629,7 +1592,7 @@ class VirtualMachineScaleSetExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1669,7 +1632,7 @@ class VirtualMachineScaleSetExtensions { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1677,9 +1640,7 @@ class VirtualMachineScaleSetExtensions { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetRollingUpgrades.js b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetRollingUpgrades.js index 920f0cb874..dbb587431e 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetRollingUpgrades.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetRollingUpgrades.js @@ -33,9 +33,7 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -73,20 +71,6 @@ function _cancel(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -114,9 +98,7 @@ function _cancel(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -154,20 +136,71 @@ function _startOSUpgrade(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _startExtensionUpgrade(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint 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.beginStartExtensionUpgrade(resourceGroupName, vmScaleSetName, 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); }); @@ -210,7 +243,7 @@ function _getLatest(resourceGroupName, vmScaleSetName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -336,9 +369,7 @@ function _getLatest(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -354,7 +385,7 @@ function _beginCancel(resourceGroupName, vmScaleSetName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -440,23 +471,6 @@ function _beginCancel(resourceGroupName, vmScaleSetName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -482,9 +496,7 @@ function _beginCancel(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -500,7 +512,7 @@ function _beginStartOSUpgrade(resourceGroupName, vmScaleSetName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -586,23 +598,133 @@ function _beginStartOSUpgrade(resourceGroupName, vmScaleSetName, options, callba // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _beginStartExtensionUpgrade(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint 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 apiVersion = '2018-10-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); + 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; } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); + 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); }); @@ -618,9 +740,11 @@ class VirtualMachineScaleSetRollingUpgrades { this.client = client; this._cancel = _cancel; this._startOSUpgrade = _startOSUpgrade; + this._startExtensionUpgrade = _startExtensionUpgrade; this._getLatest = _getLatest; this._beginCancel = _beginCancel; this._beginStartOSUpgrade = _beginStartOSUpgrade; + this._beginStartExtensionUpgrade = _beginStartExtensionUpgrade; } /** @@ -637,7 +761,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -674,7 +798,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -682,9 +806,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -726,7 +848,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -765,7 +887,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -773,9 +895,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -801,6 +921,95 @@ class VirtualMachineScaleSetRollingUpgrades { } } + /** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + startExtensionUpgradeWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startExtensionUpgrade(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + startExtensionUpgrade(resourceGroupName, vmScaleSetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startExtensionUpgrade(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startExtensionUpgrade(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + /** * Gets the status of the latest virtual machine scale set rolling upgrade. * @@ -902,7 +1111,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -939,7 +1148,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -947,9 +1156,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -991,7 +1198,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1030,7 +1237,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1038,9 +1245,7 @@ class VirtualMachineScaleSetRollingUpgrades { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1066,6 +1271,95 @@ class VirtualMachineScaleSetRollingUpgrades { } } + /** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginStartExtensionUpgradeWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStartExtensionUpgrade(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine + * scale set instances to the latest available extension version. Instances + * which are already running the latest extension versions are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + beginStartExtensionUpgrade(resourceGroupName, vmScaleSetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginStartExtensionUpgrade(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStartExtensionUpgrade(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + } module.exports = VirtualMachineScaleSetRollingUpgrades; diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetVMs.js b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetVMs.js index a86c085fe7..ee90846638 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetVMs.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetVMs.js @@ -36,9 +36,7 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -76,20 +74,6 @@ function _reimage(resourceGroupName, vmScaleSetName, instanceId, options, callba 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -118,9 +102,7 @@ function _reimage(resourceGroupName, vmScaleSetName, instanceId, options, callba * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -158,20 +140,6 @@ function _reimageAll(resourceGroupName, vmScaleSetName, instanceId, options, cal 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -202,9 +170,7 @@ function _reimageAll(resourceGroupName, vmScaleSetName, instanceId, options, cal * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -242,20 +208,6 @@ function _deallocate(resourceGroupName, vmScaleSetName, instanceId, options, cal 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -432,6 +384,14 @@ function _deallocate(resourceGroupName, vmScaleSetName, instanceId, options, cal * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -444,7 +404,7 @@ function _deallocate(resourceGroupName, vmScaleSetName, instanceId, options, cal * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -452,9 +412,9 @@ function _deallocate(resourceGroupName, vmScaleSetName, instanceId, options, cal * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -465,6 +425,17 @@ function _deallocate(resourceGroupName, vmScaleSetName, instanceId, options, cal * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -561,9 +532,20 @@ function _deallocate(resourceGroupName, vmScaleSetName, instanceId, options, cal * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -576,9 +558,8 @@ function _deallocate(resourceGroupName, vmScaleSetName, instanceId, options, cal * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -726,9 +707,7 @@ function _update(resourceGroupName, vmScaleSetName, instanceId, parameters, opti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -766,20 +745,6 @@ function _deleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, c 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -824,7 +789,7 @@ function _get(resourceGroupName, vmScaleSetName, instanceId, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -974,7 +939,7 @@ function _getInstanceView(resourceGroupName, vmScaleSetName, instanceId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1132,7 +1097,7 @@ function _list(resourceGroupName, virtualMachineScaleSetName, options, callback) let filter = (options && options.filter !== undefined) ? options.filter : undefined; let select = (options && options.select !== undefined) ? options.select : undefined; let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1281,9 +1246,7 @@ function _list(resourceGroupName, virtualMachineScaleSetName, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1321,20 +1284,6 @@ function _powerOff(resourceGroupName, vmScaleSetName, instanceId, options, callb 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1362,9 +1311,7 @@ function _powerOff(resourceGroupName, vmScaleSetName, instanceId, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1402,20 +1349,6 @@ function _restart(resourceGroupName, vmScaleSetName, instanceId, options, callba 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1443,9 +1376,7 @@ function _restart(resourceGroupName, vmScaleSetName, instanceId, options, callba * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1483,20 +1414,6 @@ function _start(resourceGroupName, vmScaleSetName, instanceId, options, callback 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1524,9 +1441,7 @@ function _start(resourceGroupName, vmScaleSetName, instanceId, options, callback * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1564,20 +1479,6 @@ function _redeploy(resourceGroupName, vmScaleSetName, instanceId, options, callb 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1605,9 +1506,7 @@ function _redeploy(resourceGroupName, vmScaleSetName, instanceId, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1629,6 +1528,82 @@ function _performMaintenance(resourceGroupName, vmScaleSetName, instanceId, opti this.beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, 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); + }); + }); +} + + +/** + * Run command on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _runCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRunCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + let initialResult = new msRest.HttpOperationResponse(); initialResult.request = httpRequest; initialResult.response = response; @@ -1650,7 +1625,7 @@ function _performMaintenance(resourceGroupName, vmScaleSetName, instanceId, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); + let resultMapper = new client.models['RunCommandResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1686,9 +1661,7 @@ function _performMaintenance(resourceGroupName, vmScaleSetName, instanceId, opti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1704,7 +1677,7 @@ function _beginReimage(resourceGroupName, vmScaleSetName, instanceId, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1794,23 +1767,6 @@ function _beginReimage(resourceGroupName, vmScaleSetName, instanceId, options, c // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -1837,9 +1793,7 @@ function _beginReimage(resourceGroupName, vmScaleSetName, instanceId, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1855,7 +1809,7 @@ function _beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1945,23 +1899,6 @@ function _beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, options // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -1990,9 +1927,7 @@ function _beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, options * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2008,7 +1943,7 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2098,23 +2033,6 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -2289,6 +2207,14 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -2301,7 +2227,7 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -2309,9 +2235,9 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -2322,6 +2248,17 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -2418,9 +2355,20 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -2433,9 +2381,8 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -2520,7 +2467,7 @@ function _beginUpdate(resourceGroupName, vmScaleSetName, instanceId, parameters, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2686,9 +2633,7 @@ function _beginUpdate(resourceGroupName, vmScaleSetName, instanceId, parameters, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2704,7 +2649,7 @@ function _beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2794,23 +2739,6 @@ function _beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, optio // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -2838,9 +2766,7 @@ function _beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, optio * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2856,7 +2782,7 @@ function _beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2946,23 +2872,6 @@ function _beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options, // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -2988,9 +2897,7 @@ function _beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3006,7 +2913,7 @@ function _beginRestart(resourceGroupName, vmScaleSetName, instanceId, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3096,23 +3003,6 @@ function _beginRestart(resourceGroupName, vmScaleSetName, instanceId, options, c // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -3138,9 +3028,7 @@ function _beginRestart(resourceGroupName, vmScaleSetName, instanceId, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3156,7 +3044,7 @@ function _beginStart(resourceGroupName, vmScaleSetName, instanceId, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3246,23 +3134,6 @@ function _beginStart(resourceGroupName, vmScaleSetName, instanceId, options, cal // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -3288,9 +3159,7 @@ function _beginStart(resourceGroupName, vmScaleSetName, instanceId, options, cal * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3306,7 +3175,7 @@ function _beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3396,30 +3265,144 @@ function _beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _beginPerformMaintenance(resourceGroupName, vmScaleSetName, 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.'); + } + let apiVersion = '2018-10-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); + 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; } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); + 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); }); } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Run command on a virtual machine in a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * @@ -3427,6 +3410,16 @@ function _beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, * * @param {string} instanceId The instance ID of the virtual machine. * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3439,14 +3432,13 @@ function _beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * See {@link RunCommandResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, callback) { +function _beginRunCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3456,7 +3448,7 @@ function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3468,6 +3460,9 @@ function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, 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 (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.'); } @@ -3480,7 +3475,7 @@ function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); @@ -3511,7 +3506,21 @@ function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['RunCommandInput']().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) { @@ -3553,7 +3562,7 @@ function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); + let resultMapper = new client.models['RunCommandResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3717,6 +3726,7 @@ class VirtualMachineScaleSetVMs { this._start = _start; this._redeploy = _redeploy; this._performMaintenance = _performMaintenance; + this._runCommand = _runCommand; this._beginReimage = _beginReimage; this._beginReimageAll = _beginReimageAll; this._beginDeallocate = _beginDeallocate; @@ -3727,6 +3737,7 @@ class VirtualMachineScaleSetVMs { this._beginStart = _beginStart; this._beginRedeploy = _beginRedeploy; this._beginPerformMaintenance = _beginPerformMaintenance; + this._beginRunCommand = _beginRunCommand; this._listNext = _listNext; } @@ -3747,7 +3758,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3787,7 +3798,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3795,9 +3806,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3840,7 +3849,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3880,7 +3889,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3888,9 +3897,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3935,7 +3942,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3977,7 +3984,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3985,9 +3992,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4182,6 +4187,14 @@ class VirtualMachineScaleSetVMs { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -4194,7 +4207,7 @@ class VirtualMachineScaleSetVMs { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -4202,9 +4215,9 @@ class VirtualMachineScaleSetVMs { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -4215,6 +4228,17 @@ class VirtualMachineScaleSetVMs { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -4311,9 +4335,20 @@ class VirtualMachineScaleSetVMs { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -4326,9 +4361,8 @@ class VirtualMachineScaleSetVMs { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -4578,6 +4612,14 @@ class VirtualMachineScaleSetVMs { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -4590,7 +4632,7 @@ class VirtualMachineScaleSetVMs { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -4598,9 +4640,9 @@ class VirtualMachineScaleSetVMs { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -4611,6 +4653,17 @@ class VirtualMachineScaleSetVMs { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -4707,9 +4760,20 @@ class VirtualMachineScaleSetVMs { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -4722,9 +4786,8 @@ class VirtualMachineScaleSetVMs { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -4844,7 +4907,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -4883,7 +4946,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4891,9 +4954,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5220,7 +5281,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -5261,7 +5322,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5269,9 +5330,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5313,7 +5372,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -5352,7 +5411,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5360,9 +5419,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5404,7 +5461,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -5443,7 +5500,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5451,9 +5508,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5495,7 +5550,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -5534,7 +5589,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5542,9 +5597,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5586,7 +5639,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -5625,7 +5678,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5633,9 +5686,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5661,6 +5712,116 @@ class VirtualMachineScaleSetVMs { } } + /** + * Run command on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + runCommandWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._runCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RunCommandResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + runCommand(resourceGroupName, vmScaleSetName, instanceId, 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._runCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._runCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, optionalCallback); + } + } + /** * Reimages (upgrade the operating system) a specific virtual machine in a VM * scale set. @@ -5678,7 +5839,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -5718,7 +5879,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5726,9 +5887,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5771,7 +5930,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -5811,7 +5970,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5819,9 +5978,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5866,7 +6023,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -5908,7 +6065,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5916,9 +6073,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -6113,6 +6268,14 @@ class VirtualMachineScaleSetVMs { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -6125,7 +6288,7 @@ class VirtualMachineScaleSetVMs { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -6133,9 +6296,9 @@ class VirtualMachineScaleSetVMs { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -6146,6 +6309,17 @@ class VirtualMachineScaleSetVMs { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -6242,9 +6416,20 @@ class VirtualMachineScaleSetVMs { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -6257,9 +6442,8 @@ class VirtualMachineScaleSetVMs { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -6509,6 +6693,14 @@ class VirtualMachineScaleSetVMs { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -6521,7 +6713,7 @@ class VirtualMachineScaleSetVMs { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -6529,9 +6721,9 @@ class VirtualMachineScaleSetVMs { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -6542,6 +6734,17 @@ class VirtualMachineScaleSetVMs { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine in the scale set. + * For instance: whether the virtual machine has the capability to support + * attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -6638,9 +6841,20 @@ class VirtualMachineScaleSetVMs { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -6653,9 +6867,8 @@ class VirtualMachineScaleSetVMs { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -6775,7 +6988,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -6814,7 +7027,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6822,9 +7035,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -6868,7 +7079,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -6909,7 +7120,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6917,9 +7128,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -6961,7 +7170,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7000,7 +7209,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7008,9 +7217,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -7052,7 +7259,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7091,7 +7298,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7099,9 +7306,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -7143,7 +7348,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7182,7 +7387,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7190,9 +7395,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -7234,7 +7437,7 @@ class VirtualMachineScaleSetVMs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7273,7 +7476,7 @@ class VirtualMachineScaleSetVMs { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7281,9 +7484,7 @@ class VirtualMachineScaleSetVMs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -7309,6 +7510,116 @@ class VirtualMachineScaleSetVMs { } } + /** + * Run command on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginRunCommandWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRunCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RunCommandResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRunCommand(resourceGroupName, vmScaleSetName, instanceId, 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._beginRunCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRunCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, options, optionalCallback); + } + } + /** * Gets a list of all virtual machines in a VM scale sets. * diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js index f47ba7554c..0c7bc2da54 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js @@ -97,9 +97,19 @@ const WebResource = msRest.WebResource; * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -207,6 +217,13 @@ const WebResource = msRest.WebResource; * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -278,6 +295,22 @@ const WebResource = msRest.WebResource; * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -304,9 +337,10 @@ const WebResource = msRest.WebResource; * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -314,6 +348,19 @@ const WebResource = msRest.WebResource; * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -340,9 +387,8 @@ const WebResource = msRest.WebResource; * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -377,6 +423,11 @@ const WebResource = msRest.WebResource; * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -399,10 +450,10 @@ const WebResource = msRest.WebResource; * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -559,9 +610,19 @@ function _createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -621,6 +682,13 @@ function _createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -669,6 +737,12 @@ function _createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -689,9 +763,10 @@ function _createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -709,9 +784,8 @@ function _createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -749,10 +823,10 @@ function _createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -846,9 +920,7 @@ function _update(resourceGroupName, vmScaleSetName, parameters, options, callbac * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -886,20 +958,6 @@ function _deleteMethod(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -942,7 +1000,7 @@ function _get(resourceGroupName, vmScaleSetName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1076,9 +1134,7 @@ function _get(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1116,20 +1172,6 @@ function _deallocate(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1157,9 +1199,7 @@ function _deallocate(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1197,20 +1237,6 @@ function _deleteInstances(resourceGroupName, vmScaleSetName, instanceIds, option 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1253,7 +1279,7 @@ function _getInstanceView(resourceGroupName, vmScaleSetName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1395,7 +1421,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1534,7 +1560,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1671,7 +1697,7 @@ function _listSkus(resourceGroupName, vmScaleSetName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1779,6 +1805,150 @@ function _listSkus(resourceGroupName, vmScaleSetName, options, callback) { }); } +/** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint 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 apiVersion = '2018-10-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetListOSUpgradeHistory']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * Power off (stop) one or more virtual machines in a VM scale set. Note that @@ -1805,9 +1975,7 @@ function _listSkus(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1845,20 +2013,6 @@ function _powerOff(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1889,9 +2043,7 @@ function _powerOff(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1929,20 +2081,6 @@ function _restart(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1973,9 +2111,7 @@ function _restart(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2013,20 +2149,6 @@ function _start(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2057,9 +2179,7 @@ function _start(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2088,30 +2208,16 @@ function _redeploy(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - + // 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); }); }); @@ -2120,6 +2226,9 @@ function _redeploy(resourceGroupName, vmScaleSetName, options, callback) { /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -2141,9 +2250,7 @@ function _redeploy(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2181,20 +2288,6 @@ function _performMaintenance(resourceGroupName, vmScaleSetName, options, callbac 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2223,9 +2316,7 @@ function _performMaintenance(resourceGroupName, vmScaleSetName, options, callbac * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2263,20 +2354,6 @@ function _updateInstances(resourceGroupName, vmScaleSetName, instanceIds, option 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2308,9 +2385,7 @@ function _updateInstances(resourceGroupName, vmScaleSetName, instanceIds, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2348,20 +2423,6 @@ function _reimage(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2393,9 +2454,7 @@ function _reimage(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2433,20 +2492,6 @@ function _reimageAll(resourceGroupName, vmScaleSetName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2492,7 +2537,7 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2686,9 +2731,19 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -2796,6 +2851,13 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -2867,6 +2929,22 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -2893,9 +2971,10 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -2903,6 +2982,19 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -2929,9 +3021,8 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -2966,6 +3057,11 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -2988,10 +3084,10 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -3028,7 +3124,7 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3247,9 +3343,19 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, opt * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -3309,6 +3415,13 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, opt * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -3357,6 +3470,12 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, opt * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -3377,9 +3496,10 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, opt * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -3397,9 +3517,8 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, opt * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -3437,10 +3556,10 @@ function _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, opt * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -3473,7 +3592,7 @@ function _beginUpdate(resourceGroupName, vmScaleSetName, parameters, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3616,9 +3735,7 @@ function _beginUpdate(resourceGroupName, vmScaleSetName, parameters, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3634,7 +3751,7 @@ function _beginDeleteMethod(resourceGroupName, vmScaleSetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3720,23 +3837,6 @@ function _beginDeleteMethod(resourceGroupName, vmScaleSetName, options, callback // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -3767,9 +3867,7 @@ function _beginDeleteMethod(resourceGroupName, vmScaleSetName, options, callback * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3786,7 +3884,7 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, options, callback) throw new Error('callback cannot be null.'); } let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3898,23 +3996,6 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, options, callback) // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -3940,9 +4021,7 @@ function _beginDeallocate(resourceGroupName, vmScaleSetName, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -3958,7 +4037,7 @@ function _beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4071,23 +4150,6 @@ function _beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, o // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4118,9 +4180,7 @@ function _beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4137,7 +4197,7 @@ function _beginPowerOff(resourceGroupName, vmScaleSetName, options, callback) { throw new Error('callback cannot be null.'); } let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4249,23 +4309,6 @@ function _beginPowerOff(resourceGroupName, vmScaleSetName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4294,9 +4337,7 @@ function _beginPowerOff(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4313,7 +4354,7 @@ function _beginRestart(resourceGroupName, vmScaleSetName, options, callback) { throw new Error('callback cannot be null.'); } let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4425,23 +4466,6 @@ function _beginRestart(resourceGroupName, vmScaleSetName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4470,9 +4494,7 @@ function _beginRestart(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4489,7 +4511,7 @@ function _beginStart(resourceGroupName, vmScaleSetName, options, callback) { throw new Error('callback cannot be null.'); } let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4601,23 +4623,6 @@ function _beginStart(resourceGroupName, vmScaleSetName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4646,9 +4651,7 @@ function _beginStart(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4665,7 +4668,7 @@ function _beginRedeploy(resourceGroupName, vmScaleSetName, options, callback) { throw new Error('callback cannot be null.'); } let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4777,23 +4780,6 @@ function _beginRedeploy(resourceGroupName, vmScaleSetName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4801,6 +4787,9 @@ function _beginRedeploy(resourceGroupName, vmScaleSetName, options, callback) { /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -4822,9 +4811,7 @@ function _beginRedeploy(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4841,7 +4828,7 @@ function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, options, ca throw new Error('callback cannot be null.'); } let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4941,35 +4928,18 @@ function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, options, ca } 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); }); @@ -4996,9 +4966,7 @@ function _beginPerformMaintenance(resourceGroupName, vmScaleSetName, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5014,7 +4982,7 @@ function _beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5127,23 +5095,6 @@ function _beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, o // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -5173,9 +5124,7 @@ function _beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5192,7 +5141,7 @@ function _beginReimage(resourceGroupName, vmScaleSetName, options, callback) { throw new Error('callback cannot be null.'); } let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5304,23 +5253,6 @@ function _beginReimage(resourceGroupName, vmScaleSetName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -5350,9 +5282,7 @@ function _beginReimage(resourceGroupName, vmScaleSetName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -5369,7 +5299,7 @@ function _beginReimageAll(resourceGroupName, vmScaleSetName, options, callback) throw new Error('callback cannot be null.'); } let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5481,23 +5411,6 @@ function _beginReimageAll(resourceGroupName, vmScaleSetName, options, callback) // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -5891,6 +5804,134 @@ function _listSkusNext(nextPageLink, options, callback) { }); } +/** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous 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 VirtualMachineScaleSetListOSUpgradeHistory} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getOSUpgradeHistoryNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetListOSUpgradeHistory']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 VirtualMachineScaleSets. */ class VirtualMachineScaleSets { /** @@ -5909,6 +5950,7 @@ class VirtualMachineScaleSets { this._list = _list; this._listAll = _listAll; this._listSkus = _listSkus; + this._getOSUpgradeHistory = _getOSUpgradeHistory; this._powerOff = _powerOff; this._restart = _restart; this._start = _start; @@ -5934,6 +5976,7 @@ class VirtualMachineScaleSets { this._listNext = _listNext; this._listAllNext = _listAllNext; this._listSkusNext = _listSkusNext; + this._getOSUpgradeHistoryNext = _getOSUpgradeHistoryNext; } /** @@ -6018,9 +6061,19 @@ class VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -6128,6 +6181,13 @@ class VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -6199,6 +6259,22 @@ class VirtualMachineScaleSets { * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -6225,9 +6301,10 @@ class VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -6235,6 +6312,19 @@ class VirtualMachineScaleSets { * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -6261,9 +6351,8 @@ class VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -6298,6 +6387,11 @@ class VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -6320,10 +6414,10 @@ class VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -6438,9 +6532,19 @@ class VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -6548,6 +6652,13 @@ class VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -6619,6 +6730,22 @@ class VirtualMachineScaleSets { * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -6645,9 +6772,10 @@ class VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -6655,6 +6783,19 @@ class VirtualMachineScaleSets { * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -6681,9 +6822,8 @@ class VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -6718,6 +6858,11 @@ class VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -6740,10 +6885,10 @@ class VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -6876,9 +7021,19 @@ class VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -6938,6 +7093,13 @@ class VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -6986,6 +7148,12 @@ class VirtualMachineScaleSets { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -7006,9 +7174,10 @@ class VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -7026,9 +7195,8 @@ class VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -7066,10 +7234,10 @@ class VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -7175,9 +7343,19 @@ class VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -7237,6 +7415,13 @@ class VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -7285,6 +7470,12 @@ class VirtualMachineScaleSets { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -7305,9 +7496,10 @@ class VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -7325,9 +7517,8 @@ class VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -7365,10 +7556,10 @@ class VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -7434,7 +7625,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7471,7 +7662,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7479,9 +7670,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -7615,7 +7804,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7659,7 +7848,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7667,9 +7856,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -7711,7 +7898,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7750,7 +7937,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7758,9 +7945,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8130,6 +8315,93 @@ class VirtualMachineScaleSets { } } + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getOSUpgradeHistoryWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineScaleSetListOSUpgradeHistory} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + /** * Power off (stop) one or more virtual machines in a VM scale set. Note that * resources are still attached and you are getting charged for the resources. @@ -8151,7 +8423,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8195,7 +8467,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8203,9 +8475,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8250,7 +8520,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8292,7 +8562,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8300,9 +8570,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8347,7 +8615,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8389,7 +8657,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8397,9 +8665,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8444,7 +8710,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8486,7 +8752,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8494,9 +8760,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8524,6 +8788,9 @@ class VirtualMachineScaleSets { /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -8541,7 +8808,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8561,6 +8828,9 @@ class VirtualMachineScaleSets { /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -8583,7 +8853,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8591,9 +8861,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8636,7 +8904,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8676,7 +8944,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8684,9 +8952,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8732,7 +8998,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8775,7 +9041,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8783,9 +9049,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8831,7 +9095,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8874,7 +9138,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8882,9 +9146,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -9086,9 +9348,19 @@ class VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -9196,6 +9468,13 @@ class VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -9267,6 +9546,22 @@ class VirtualMachineScaleSets { * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -9293,9 +9588,10 @@ class VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -9303,6 +9599,19 @@ class VirtualMachineScaleSets { * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -9329,9 +9638,8 @@ class VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -9366,6 +9674,11 @@ class VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -9388,10 +9701,10 @@ class VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -9506,9 +9819,19 @@ class VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -9616,6 +9939,13 @@ class VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] * Specifies set of certificates that should be installed onto the virtual * machines in the scale set. @@ -9687,6 +10017,22 @@ class VirtualMachineScaleSets { * plan element previously described. Possible values include: 'FromImage', * 'Empty', 'Attach' * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This * property allows you to specify the type of the OS that is included in the @@ -9713,9 +10059,10 @@ class VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * Specifies the parameters that are used to add data disks to the virtual @@ -9723,6 +10070,19 @@ class VirtualMachineScaleSets { * [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.virtualMachineProfile.additionalCapabilities] + * Specifies additional capabilities enabled or disabled on the virtual machine + * in the scale set. For instance: whether the virtual machine has the + * capability to support attaching managed data disks with UltraSSD_LRS storage + * account type. + * + * @param {boolean} + * [parameters.virtualMachineProfile.additionalCapabilities.ultraSSDEnabled] + * The flag that enables or disables a capability to have one or more managed + * data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies * properties of the network interfaces of the virtual machines in the scale * set. @@ -9749,9 +10109,8 @@ class VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -9786,6 +10145,11 @@ class VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in a low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -9808,10 +10172,10 @@ class VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine scale set zones. * @@ -9944,9 +10308,19 @@ class VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -10006,6 +10380,13 @@ class VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -10054,6 +10435,12 @@ class VirtualMachineScaleSets { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -10074,9 +10461,10 @@ class VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -10094,9 +10482,8 @@ class VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -10134,10 +10521,10 @@ class VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -10243,9 +10630,19 @@ class VirtualMachineScaleSets { * batch and starting the next batch. The time duration should be specified in * ISO 8601 format. The default value is 0 seconds (PT0S). * - * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS - * upgrades should automatically be applied to scale set instances in a rolling - * fashion when a newer version of the image becomes available. + * @param {object} [parameters.upgradePolicy.automaticOSUpgradePolicy] + * Configuration parameters used for performing automatic OS Upgrade. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade] + * Whether OS upgrades should automatically be applied to scale set instances + * in a rolling fashion when a newer version of the image becomes available. + * Default value is false. + * + * @param {boolean} + * [parameters.upgradePolicy.automaticOSUpgradePolicy.disableAutomaticRollback] + * Whether OS image rollback feature should be disabled. Default value is + * false. * * @param {object} [parameters.virtualMachineProfile] The virtual machine * profile. @@ -10305,6 +10702,13 @@ class VirtualMachineScaleSets { * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] * The list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List * of certificates for addition to the VM. * @@ -10353,6 +10757,12 @@ class VirtualMachineScaleSets { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {number} + * [parameters.virtualMachineProfile.storageProfile.osDisk.diskSizeGB] + * Specifies the size of the operating system disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + * * @param {object} * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using @@ -10373,9 +10783,10 @@ class VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. Possible + * values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + * 'UltraSSD_LRS' * * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] * The data disks. @@ -10393,9 +10804,8 @@ class VirtualMachineScaleSets { * @param {object} * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} @@ -10433,10 +10843,10 @@ class VirtualMachineScaleSets { * set. Possible values include: 'SystemAssigned', 'UserAssigned', * 'SystemAssigned, UserAssigned', 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the virtual machine scale set. The user identity references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the virtual machine scale set. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {object} [parameters.tags] Resource tags * @@ -10502,7 +10912,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -10539,7 +10949,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -10547,9 +10957,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -10596,7 +11004,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -10640,7 +11048,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -10648,9 +11056,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -10692,7 +11098,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -10731,7 +11137,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -10739,9 +11145,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -10788,7 +11192,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -10832,7 +11236,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -10840,9 +11244,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -10887,7 +11289,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -10929,7 +11331,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -10937,9 +11339,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -10984,7 +11384,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11026,7 +11426,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11034,9 +11434,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11081,7 +11479,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11123,7 +11521,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11131,9 +11529,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11161,6 +11557,9 @@ class VirtualMachineScaleSets { /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -11178,7 +11577,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11198,6 +11597,9 @@ class VirtualMachineScaleSets { /** * Perform maintenance on one or more virtual machines in a VM scale set. + * Operation on instances which are not eligible for perform maintenance will + * be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * * @param {string} resourceGroupName The name of the resource group. * @@ -11220,7 +11622,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11228,9 +11630,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11273,7 +11673,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11313,7 +11713,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11321,9 +11721,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11369,7 +11767,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11412,7 +11810,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11420,9 +11818,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11468,7 +11864,7 @@ class VirtualMachineScaleSets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11511,7 +11907,7 @@ class VirtualMachineScaleSets { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11519,9 +11915,7 @@ class VirtualMachineScaleSets { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11810,6 +12204,91 @@ class VirtualMachineScaleSets { } } + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getOSUpgradeHistoryNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getOSUpgradeHistoryNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous 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 {VirtualMachineScaleSetListOSUpgradeHistory} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getOSUpgradeHistoryNext(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._getOSUpgradeHistoryNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getOSUpgradeHistoryNext(nextPageLink, options, optionalCallback); + } + } + } module.exports = VirtualMachineScaleSets; diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineSizes.js b/lib/services/computeManagement2/lib/operations/virtualMachineSizes.js index f56a070623..473be0dfa5 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineSizes.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineSizes.js @@ -15,7 +15,8 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Lists all available virtual machine sizes for a subscription in a location. + * This API is deprecated. Use [Resources + * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) * * @param {string} location The location upon which virtual-machine-sizes is * queried. @@ -49,7 +50,7 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -171,7 +172,8 @@ class VirtualMachineSizes { } /** - * Lists all available virtual machine sizes for a subscription in a location. + * This API is deprecated. Use [Resources + * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) * * @param {string} location The location upon which virtual-machine-sizes is * queried. @@ -202,7 +204,8 @@ class VirtualMachineSizes { } /** - * Lists all available virtual machine sizes for a subscription in a location. + * This API is deprecated. Use [Resources + * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) * * @param {string} location The location upon which virtual-machine-sizes is * queried. diff --git a/lib/services/computeManagement2/lib/operations/virtualMachines.js b/lib/services/computeManagement2/lib/operations/virtualMachines.js index c5c28bb9c3..7d88e6ee67 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachines.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachines.js @@ -15,18 +15,14 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * The operation to get all extensions of a Virtual Machine. + * Gets all the virtual machines under the specified subscription for the + * specified location. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine containing the - * extension. + * @param {string} location The location for which virtual machines under the + * subscription are queried. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -37,14 +33,14 @@ const WebResource = msRest.WebResource; * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineExtensionsListResult} for more + * See {@link VirtualMachineListResult} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getExtensions(resourceGroupName, vmName, options, callback) { +function _listByLocation(location, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54,18 +50,17 @@ function _getExtensions(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { - throw new Error('vmName cannot be null or undefined and it must be of type string.'); + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); } - if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand must be of type string.'); + if (location !== null && location !== undefined) { + if (location.match(/^[-\w\._]+$/) === null) + { + throw new Error('"location" 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.'); @@ -79,14 +74,10 @@ function _getExtensions(resourceGroupName, vmName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -154,7 +145,7 @@ function _getExtensions(resourceGroupName, vmName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualMachineExtensionsListResult']().mapper(); + let resultMapper = new client.models['VirtualMachineListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -446,6 +437,14 @@ function _capture(resourceGroupName, vmName, parameters, options, callback) { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -458,7 +457,7 @@ function _capture(resourceGroupName, vmName, parameters, options, callback) { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -466,9 +465,9 @@ function _capture(resourceGroupName, vmName, parameters, options, callback) { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -479,6 +478,15 @@ function _capture(resourceGroupName, vmName, parameters, options, callback) { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -575,9 +583,20 @@ function _capture(resourceGroupName, vmName, parameters, options, callback) { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -590,9 +609,8 @@ function _capture(resourceGroupName, vmName, parameters, options, callback) { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -636,10 +654,10 @@ function _capture(resourceGroupName, vmName, parameters, options, callback) { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -902,6 +920,14 @@ function _createOrUpdate(resourceGroupName, vmName, parameters, options, callbac * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -914,7 +940,7 @@ function _createOrUpdate(resourceGroupName, vmName, parameters, options, callbac * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -922,9 +948,9 @@ function _createOrUpdate(resourceGroupName, vmName, parameters, options, callbac * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -935,6 +961,15 @@ function _createOrUpdate(resourceGroupName, vmName, parameters, options, callbac * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -1031,9 +1066,20 @@ function _createOrUpdate(resourceGroupName, vmName, parameters, options, callbac * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -1046,9 +1092,8 @@ function _createOrUpdate(resourceGroupName, vmName, parameters, options, callbac * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -1092,10 +1137,10 @@ function _createOrUpdate(resourceGroupName, vmName, parameters, options, callbac * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -1190,9 +1235,7 @@ function _update(resourceGroupName, vmName, parameters, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1230,20 +1273,6 @@ function _deleteMethod(resourceGroupName, vmName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1290,7 +1319,7 @@ function _get(resourceGroupName, vmName, options, callback) { throw new Error('callback cannot be null.'); } let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1443,7 +1472,7 @@ function _instanceView(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1571,9 +1600,7 @@ function _instanceView(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1611,20 +1638,6 @@ function _convertToManagedDisks(resourceGroupName, vmName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1651,9 +1664,7 @@ function _convertToManagedDisks(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1691,20 +1702,6 @@ function _deallocate(resourceGroupName, vmName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -1729,9 +1726,7 @@ function _deallocate(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1747,7 +1742,7 @@ function _generalize(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1833,23 +1828,6 @@ function _generalize(resourceGroupName, vmName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -1890,7 +1868,7 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2027,7 +2005,7 @@ function _listAll(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2164,7 +2142,7 @@ function _listAvailableSizes(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2293,9 +2271,7 @@ function _listAvailableSizes(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2333,20 +2309,6 @@ function _powerOff(resourceGroupName, vmName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2372,9 +2334,7 @@ function _powerOff(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2412,20 +2372,6 @@ function _restart(resourceGroupName, vmName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2451,9 +2397,7 @@ function _restart(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2491,20 +2435,6 @@ function _start(resourceGroupName, vmName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2530,9 +2460,7 @@ function _start(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2570,20 +2498,6 @@ function _redeploy(resourceGroupName, vmName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2609,9 +2523,7 @@ function _redeploy(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2649,20 +2561,6 @@ function _performMaintenance(resourceGroupName, vmName, options, callback) { 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['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -2806,7 +2704,7 @@ function _beginCapture(resourceGroupName, vmName, parameters, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3115,6 +3013,14 @@ function _beginCapture(resourceGroupName, vmName, parameters, options, callback) * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -3127,7 +3033,7 @@ function _beginCapture(resourceGroupName, vmName, parameters, options, callback) * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -3135,9 +3041,9 @@ function _beginCapture(resourceGroupName, vmName, parameters, options, callback) * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -3148,6 +3054,15 @@ function _beginCapture(resourceGroupName, vmName, parameters, options, callback) * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -3244,9 +3159,20 @@ function _beginCapture(resourceGroupName, vmName, parameters, options, callback) * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -3259,9 +3185,8 @@ function _beginCapture(resourceGroupName, vmName, parameters, options, callback) * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -3305,10 +3230,10 @@ function _beginCapture(resourceGroupName, vmName, parameters, options, callback) * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -3344,7 +3269,7 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3670,6 +3595,14 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, ca * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -3682,7 +3615,7 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, ca * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -3690,9 +3623,9 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, ca * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -3703,6 +3636,15 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, ca * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -3799,9 +3741,20 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, ca * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -3814,9 +3767,8 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, ca * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -3860,10 +3812,10 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, ca * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -3897,7 +3849,7 @@ function _beginUpdate(resourceGroupName, vmName, parameters, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4057,9 +4009,7 @@ function _beginUpdate(resourceGroupName, vmName, parameters, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4075,7 +4025,7 @@ function _beginDeleteMethod(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4161,23 +4111,6 @@ function _beginDeleteMethod(resourceGroupName, vmName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4202,9 +4135,7 @@ function _beginDeleteMethod(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4220,7 +4151,7 @@ function _beginConvertToManagedDisks(resourceGroupName, vmName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4306,23 +4237,6 @@ function _beginConvertToManagedDisks(resourceGroupName, vmName, options, callbac // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4347,9 +4261,7 @@ function _beginConvertToManagedDisks(resourceGroupName, vmName, options, callbac * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4365,7 +4277,7 @@ function _beginDeallocate(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4451,23 +4363,6 @@ function _beginDeallocate(resourceGroupName, vmName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4493,9 +4388,7 @@ function _beginDeallocate(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4511,7 +4404,7 @@ function _beginPowerOff(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4597,23 +4490,6 @@ function _beginPowerOff(resourceGroupName, vmName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4637,9 +4513,7 @@ function _beginPowerOff(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4655,7 +4529,7 @@ function _beginRestart(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4741,23 +4615,6 @@ function _beginRestart(resourceGroupName, vmName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4781,9 +4638,7 @@ function _beginRestart(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4799,7 +4654,7 @@ function _beginStart(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4885,23 +4740,6 @@ function _beginStart(resourceGroupName, vmName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -4925,9 +4763,7 @@ function _beginStart(resourceGroupName, vmName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -4943,7 +4779,7 @@ function _beginRedeploy(resourceGroupName, vmName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5029,35 +4865,153 @@ function _beginRedeploy(resourceGroupName, vmName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _beginPerformMaintenance(resourceGroupName, vmName, options, callback) { + /* jshint 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 apiVersion = '2018-10-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); + 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; } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); + 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); }); } /** - * The operation to perform maintenance on a virtual machine. + * Run command on the VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5070,14 +5024,13 @@ function _beginRedeploy(resourceGroupName, vmName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * See {@link RunCommandResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginPerformMaintenance(resourceGroupName, vmName, options, callback) { +function _beginRunCommand(resourceGroupName, vmName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -5087,7 +5040,7 @@ function _beginPerformMaintenance(resourceGroupName, vmName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; + let apiVersion = '2018-10-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5096,6 +5049,9 @@ function _beginPerformMaintenance(resourceGroupName, vmName, options, callback) if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { throw new Error('vmName cannot be null or undefined and it must be of type string.'); } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -5108,7 +5064,7 @@ function _beginPerformMaintenance(resourceGroupName, vmName, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -5138,7 +5094,21 @@ function _beginPerformMaintenance(resourceGroupName, vmName, options, callback) } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['RunCommandInput']().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) { @@ -5180,7 +5150,7 @@ function _beginPerformMaintenance(resourceGroupName, vmName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); + let resultMapper = new client.models['RunCommandResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -5196,21 +5166,11 @@ function _beginPerformMaintenance(resourceGroupName, vmName, options, callback) } /** - * Run command on the VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. - * - * @param {object} parameters Parameters supplied to the Run command operation. - * - * @param {string} parameters.commandId The run command id. - * - * @param {array} [parameters.script] Optional. The script to be executed. - * When this value is given, the given script will override the default script - * of the command. + * Gets all the virtual machines under the specified subscription for the + * specified location. * - * @param {array} [parameters.parameters] The run command parameters. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5224,13 +5184,14 @@ function _beginPerformMaintenance(resourceGroupName, vmName, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RunCommandResult} for more information. + * See {@link VirtualMachineListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRunCommand(resourceGroupName, vmName, parameters, options, callback) { +function _listByLocationNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -5240,20 +5201,10 @@ function _beginRunCommand(resourceGroupName, vmName, parameters, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-12-01'; // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { - throw new Error('vmName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + if (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.'); @@ -5263,20 +5214,12 @@ function _beginRunCommand(resourceGroupName, vmName, parameters, options, callba } // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -5294,28 +5237,14 @@ function _beginRunCommand(resourceGroupName, vmName, parameters, options, callba } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['RunCommandInput']().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; + 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) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -5350,7 +5279,7 @@ function _beginRunCommand(resourceGroupName, vmName, parameters, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RunCommandResult']().mapper(); + let resultMapper = new client.models['VirtualMachineListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -5631,7 +5560,7 @@ class VirtualMachines { */ constructor(client) { this.client = client; - this._getExtensions = _getExtensions; + this._listByLocation = _listByLocation; this._capture = _capture; this._createOrUpdate = _createOrUpdate; this._update = _update; @@ -5662,37 +5591,34 @@ class VirtualMachines { this._beginRedeploy = _beginRedeploy; this._beginPerformMaintenance = _beginPerformMaintenance; this._beginRunCommand = _beginRunCommand; + this._listByLocationNext = _listByLocationNext; this._listNext = _listNext; this._listAllNext = _listAllNext; } /** - * The operation to get all extensions of a Virtual Machine. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the virtual machines under the specified subscription for the + * specified location. * - * @param {string} vmName The name of the virtual machine containing the - * extension. + * @param {string} location The location for which virtual machines under the + * subscription are queried. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getExtensionsWithHttpOperationResponse(resourceGroupName, vmName, options) { + listByLocationWithHttpOperationResponse(location, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getExtensions(resourceGroupName, vmName, options, (err, result, request, response) => { + self._listByLocation(location, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5703,18 +5629,14 @@ class VirtualMachines { } /** - * The operation to get all extensions of a Virtual Machine. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets all the virtual machines under the specified subscription for the + * specified location. * - * @param {string} vmName The name of the virtual machine containing the - * extension. + * @param {string} location The location for which virtual machines under the + * subscription are queried. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5725,7 +5647,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {VirtualMachineExtensionsListResult} - The deserialized result object. + * @resolve {VirtualMachineListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5734,14 +5656,14 @@ class VirtualMachines { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineExtensionsListResult} for more + * See {@link VirtualMachineListResult} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getExtensions(resourceGroupName, vmName, options, optionalCallback) { + listByLocation(location, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5750,14 +5672,14 @@ class VirtualMachines { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getExtensions(resourceGroupName, vmName, options, (err, result, request, response) => { + self._listByLocation(location, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getExtensions(resourceGroupName, vmName, options, optionalCallback); + return self._listByLocation(location, options, optionalCallback); } } @@ -6058,6 +5980,14 @@ class VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -6070,7 +6000,7 @@ class VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -6078,9 +6008,9 @@ class VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -6091,6 +6021,15 @@ class VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -6187,9 +6126,20 @@ class VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -6202,9 +6152,8 @@ class VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -6248,10 +6197,10 @@ class VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -6468,6 +6417,14 @@ class VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -6480,7 +6437,7 @@ class VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -6488,9 +6445,9 @@ class VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -6501,6 +6458,15 @@ class VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -6597,9 +6563,20 @@ class VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -6612,9 +6589,8 @@ class VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -6658,10 +6634,10 @@ class VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -6900,6 +6876,14 @@ class VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -6912,7 +6896,7 @@ class VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -6920,9 +6904,9 @@ class VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -6933,6 +6917,15 @@ class VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -7029,9 +7022,20 @@ class VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -7044,9 +7048,8 @@ class VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -7090,10 +7093,10 @@ class VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -7308,6 +7311,14 @@ class VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -7320,7 +7331,7 @@ class VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -7328,9 +7339,9 @@ class VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -7341,6 +7352,15 @@ class VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -7437,9 +7457,20 @@ class VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -7452,9 +7483,8 @@ class VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -7498,10 +7528,10 @@ class VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -7568,7 +7598,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7605,7 +7635,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7613,9 +7643,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -7837,7 +7865,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7875,7 +7903,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7883,9 +7911,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -7926,7 +7952,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -7964,7 +7990,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7972,9 +7998,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8014,7 +8038,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8051,7 +8075,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8059,9 +8083,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8358,7 +8380,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8397,7 +8419,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8405,9 +8427,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8447,7 +8467,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8484,7 +8504,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8492,9 +8512,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8534,7 +8552,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8571,7 +8589,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8579,9 +8597,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8621,7 +8637,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8658,7 +8674,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8666,9 +8682,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -8708,7 +8722,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -8745,7 +8759,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -8753,9 +8767,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -9184,6 +9196,14 @@ class VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -9196,7 +9216,7 @@ class VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -9204,9 +9224,9 @@ class VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -9217,6 +9237,15 @@ class VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -9313,9 +9342,20 @@ class VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -9328,9 +9368,8 @@ class VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -9374,10 +9413,10 @@ class VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -9594,6 +9633,14 @@ class VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -9606,7 +9653,7 @@ class VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -9614,9 +9661,9 @@ class VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -9627,6 +9674,15 @@ class VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -9723,9 +9779,20 @@ class VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -9738,9 +9805,8 @@ class VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -9784,10 +9850,10 @@ class VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -10026,6 +10092,14 @@ class VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -10038,7 +10112,7 @@ class VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -10046,9 +10120,9 @@ class VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -10059,6 +10133,15 @@ class VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -10155,9 +10238,20 @@ class VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -10170,9 +10264,8 @@ class VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -10216,10 +10309,10 @@ class VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -10434,6 +10527,14 @@ class VirtualMachines { * Specifies whether writeAccelerator should be enabled or disabled on the * disk. * + * @param {object} [parameters.storageProfile.osDisk.diffDiskSettings] + * Specifies the differencing Disk Settings for the operating system disk used + * by the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.diffDiskSettings.option] + * Specifies the differencing disk settings for operating system disk. Possible + * values include: 'Local' + * * @param {string} parameters.storageProfile.osDisk.createOption Specifies how * the virtual machine should be created.

    Possible values are:

    * **Attach** \u2013 This value is used when you are using a specialized disk @@ -10446,7 +10547,7 @@ class VirtualMachines { * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This + * overwrite the size of the disk in a virtual machine image.

    This * value cannot be larger than 1023 GB * * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed @@ -10454,9 +10555,9 @@ class VirtualMachines { * * @param {string} * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * the storage account type for the managed disk. NOTE: UltraSSD_LRS can only + * be used with data disks, it cannot be used with OS Disk. Possible values + * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS' * * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource * Id @@ -10467,6 +10568,15 @@ class VirtualMachines { * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * + * @param {object} [parameters.additionalCapabilities] Specifies additional + * capabilities enabled or disabled on the virtual machine. + * + * @param {boolean} [parameters.additionalCapabilities.ultraSSDEnabled] The + * flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed + * disks with storage account type UltraSSD_LRS can be added to a virtual + * machine or virtual machine scale set only if this property is enabled. + * * @param {object} [parameters.osProfile] Specifies the operating system * settings for the virtual machine. * @@ -10563,9 +10673,20 @@ class VirtualMachines { * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The * list of SSH public keys used to authenticate with linux based VMs. * + * @param {boolean} [parameters.osProfile.linuxConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * * @param {array} [parameters.osProfile.secrets] Specifies set of certificates * that should be installed onto the virtual machine. * + * @param {boolean} [parameters.osProfile.allowExtensionOperations] Specifies + * whether extension operations should be allowed on the virtual machine. + *

    This may only be set to False when no extensions are present on the + * virtual machine. + * * @param {object} [parameters.networkProfile] Specifies the network interfaces * of the virtual machine. * @@ -10578,9 +10699,8 @@ class VirtualMachines { * * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a + * and Screenshot to diagnose VM status.

    You can easily view the + * output of your console log.

    Azure also enables you to see a * screenshot of the VM from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] @@ -10624,10 +10744,10 @@ class VirtualMachines { * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', * 'None' * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the Virtual Machine. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {array} [parameters.zones] The virtual machine zones. * @@ -10694,7 +10814,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -10731,7 +10851,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -10739,9 +10859,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -10782,7 +10900,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -10820,7 +10938,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -10828,9 +10946,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -10871,7 +10987,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -10909,7 +11025,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -10917,9 +11033,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -10961,7 +11075,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11000,7 +11114,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11008,9 +11122,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11050,7 +11162,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11087,7 +11199,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11095,9 +11207,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11137,7 +11247,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11174,7 +11284,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11182,9 +11292,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11224,7 +11332,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11261,7 +11369,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11269,9 +11377,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11311,7 +11417,7 @@ class VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -11348,7 +11454,7 @@ class VirtualMachines { * * {Promise} A promise is returned * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -11356,9 +11462,7 @@ class VirtualMachines { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -11490,6 +11594,93 @@ class VirtualMachines { } } + /** + * Gets all the virtual machines under the specified subscription for the + * specified 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. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the virtual machines under the specified subscription for the + * specified 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 {VirtualMachineListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocationNext(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._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocationNext(nextPageLink, options, optionalCallback); + } + } + /** * Lists all of the virtual machines in the specified resource group. Use the * nextLink property in the response to get the next page of virtual machines. diff --git a/lib/services/computeManagement2/package.json b/lib/services/computeManagement2/package.json index eacea5c8fb..41b7f4be57 100644 --- a/lib/services/computeManagement2/package.json +++ b/lib/services/computeManagement2/package.json @@ -4,19 +4,22 @@ "description": "ComputeManagementClient Library with typescript type definitions for node", "version": "5.1.1", "dependencies": { - "ms-rest": "^2.3.2", + "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", "main": "./lib/computeManagementClient.js", "types": "./lib/computeManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } diff --git a/lib/services/frontdoorManagement/LICENSE.txt b/lib/services/frontdoorManagement/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/frontdoorManagement/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/frontdoorManagement/README.md b/lib/services/frontdoorManagement/README.md new file mode 100644 index 0000000000..60c3cbb0ca --- /dev/null +++ b/lib/services/frontdoorManagement/README.md @@ -0,0 +1,40 @@ +--- +uid: azure-arm-frontdoor +summary: *content + +--- +# Microsoft Azure SDK for Node.js - FrontdoorManagementClient +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-frontdoor +``` + +## How to use + +### Authentication, client creation and list frontDoors as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const FrontdoorManagementClient = require("azure-arm-frontdoor"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new FrontdoorManagementClient(creds, subscriptionId); + return client.frontDoors.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/frontdoorManagement/lib/frontdoorManagementClient.d.ts b/lib/services/frontdoorManagement/lib/frontdoorManagementClient.d.ts new file mode 100644 index 0000000000..b00e448a61 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/frontdoorManagementClient.d.ts @@ -0,0 +1,211 @@ +/* + * 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 FrontdoorManagementClient extends AzureServiceClient { + /** + * Initializes a new instance of the FrontdoorManagementClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @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; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + frontDoors: operations.FrontDoors; + routingRules: operations.RoutingRules; + healthProbeSettings: operations.HealthProbeSettings; + loadBalancingSettings: operations.LoadBalancingSettings; + backendPools: operations.BackendPools; + frontendEndpoints: operations.FrontendEndpoints; + endpoints: operations.Endpoints; + policies: operations.Policies; + + + /** + * Check the availability of a Front Door resource name. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + checkFrontDoorNameAvailabilityWithHttpOperationResponse(checkFrontDoorNameAvailabilityInput: models.CheckNameAvailabilityInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Check the availability of a Front Door resource name. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CheckNameAvailabilityOutput} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CheckNameAvailabilityOutput} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityOutput} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + checkFrontDoorNameAvailability(checkFrontDoorNameAvailabilityInput: models.CheckNameAvailabilityInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkFrontDoorNameAvailability(checkFrontDoorNameAvailabilityInput: models.CheckNameAvailabilityInput, callback: ServiceCallback): void; + checkFrontDoorNameAvailability(checkFrontDoorNameAvailabilityInput: models.CheckNameAvailabilityInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Check the availability of a Front Door subdomain. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + checkFrontDoorNameAvailabilityWithSubscriptionWithHttpOperationResponse(checkFrontDoorNameAvailabilityInput: models.CheckNameAvailabilityInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Check the availability of a Front Door subdomain. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CheckNameAvailabilityOutput} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CheckNameAvailabilityOutput} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityOutput} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + checkFrontDoorNameAvailabilityWithSubscription(checkFrontDoorNameAvailabilityInput: models.CheckNameAvailabilityInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkFrontDoorNameAvailabilityWithSubscription(checkFrontDoorNameAvailabilityInput: models.CheckNameAvailabilityInput, callback: ServiceCallback): void; + checkFrontDoorNameAvailabilityWithSubscription(checkFrontDoorNameAvailabilityInput: models.CheckNameAvailabilityInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +export { FrontdoorManagementClient, models as FrontdoorManagementModels }; diff --git a/lib/services/frontdoorManagement/lib/frontdoorManagementClient.js b/lib/services/frontdoorManagement/lib/frontdoorManagementClient.js new file mode 100644 index 0000000000..77306fb076 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/frontdoorManagementClient.js @@ -0,0 +1,608 @@ +/* + * 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'); + + +/** + * Check the availability of a Front Door resource name. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityOutput} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkFrontDoorNameAvailability(checkFrontDoorNameAvailabilityInput, 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 apiVersion = '2018-08-01'; + // Validate + try { + if (checkFrontDoorNameAvailabilityInput === null || checkFrontDoorNameAvailabilityInput === undefined) { + throw new Error('checkFrontDoorNameAvailabilityInput cannot be null or undefined.'); + } + 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.Network/checkFrontDoorNameAvailability'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (checkFrontDoorNameAvailabilityInput !== null && checkFrontDoorNameAvailabilityInput !== undefined) { + let requestModelMapper = new client.models['CheckNameAvailabilityInput']().mapper(); + requestModel = client.serialize(requestModelMapper, checkFrontDoorNameAvailabilityInput, 'checkFrontDoorNameAvailabilityInput'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(checkFrontDoorNameAvailabilityInput, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CheckNameAvailabilityOutput']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Check the availability of a Front Door subdomain. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityOutput} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkFrontDoorNameAvailabilityWithSubscription(checkFrontDoorNameAvailabilityInput, 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 apiVersion = '2018-08-01'; + // Validate + try { + if (checkFrontDoorNameAvailabilityInput === null || checkFrontDoorNameAvailabilityInput === undefined) { + throw new Error('checkFrontDoorNameAvailabilityInput 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.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.Network/checkFrontDoorNameAvailability'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (checkFrontDoorNameAvailabilityInput !== null && checkFrontDoorNameAvailabilityInput !== undefined) { + let requestModelMapper = new client.models['CheckNameAvailabilityInput']().mapper(); + requestModel = client.serialize(requestModelMapper, checkFrontDoorNameAvailabilityInput, 'checkFrontDoorNameAvailabilityInput'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(checkFrontDoorNameAvailabilityInput, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CheckNameAvailabilityOutput']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 FrontdoorManagementClient. */ +class FrontdoorManagementClient extends ServiceClient { + /** + * Create a FrontdoorManagementClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @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.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.frontDoors = new operations.FrontDoors(this); + this.routingRules = new operations.RoutingRules(this); + this.healthProbeSettings = new operations.HealthProbeSettings(this); + this.loadBalancingSettings = new operations.LoadBalancingSettings(this); + this.backendPools = new operations.BackendPools(this); + this.frontendEndpoints = new operations.FrontendEndpoints(this); + this.endpoints = new operations.Endpoints(this); + this.policies = new operations.Policies(this); + this.models = models; + this._checkFrontDoorNameAvailability = _checkFrontDoorNameAvailability; + this._checkFrontDoorNameAvailabilityWithSubscription = _checkFrontDoorNameAvailabilityWithSubscription; + msRest.addSerializationMixin(this); + } + + /** + * Check the availability of a Front Door resource name. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + checkFrontDoorNameAvailabilityWithHttpOperationResponse(checkFrontDoorNameAvailabilityInput, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._checkFrontDoorNameAvailability(checkFrontDoorNameAvailabilityInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Check the availability of a Front Door resource name. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CheckNameAvailabilityOutput} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityOutput} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkFrontDoorNameAvailability(checkFrontDoorNameAvailabilityInput, 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._checkFrontDoorNameAvailability(checkFrontDoorNameAvailabilityInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkFrontDoorNameAvailability(checkFrontDoorNameAvailabilityInput, options, optionalCallback); + } + } + + /** + * Check the availability of a Front Door subdomain. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + checkFrontDoorNameAvailabilityWithSubscriptionWithHttpOperationResponse(checkFrontDoorNameAvailabilityInput, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._checkFrontDoorNameAvailabilityWithSubscription(checkFrontDoorNameAvailabilityInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Check the availability of a Front Door subdomain. + * + * @param {object} checkFrontDoorNameAvailabilityInput Input to check. + * + * @param {string} checkFrontDoorNameAvailabilityInput.name The resource name + * to validate. + * + * @param {string} checkFrontDoorNameAvailabilityInput.type The type of the + * resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CheckNameAvailabilityOutput} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityOutput} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkFrontDoorNameAvailabilityWithSubscription(checkFrontDoorNameAvailabilityInput, 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._checkFrontDoorNameAvailabilityWithSubscription(checkFrontDoorNameAvailabilityInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkFrontDoorNameAvailabilityWithSubscription(checkFrontDoorNameAvailabilityInput, options, optionalCallback); + } + } + +} + +module.exports = FrontdoorManagementClient; +module.exports['default'] = FrontdoorManagementClient; +module.exports.FrontdoorManagementClient = FrontdoorManagementClient; +module.exports.FrontdoorManagementModels = models; diff --git a/lib/services/frontdoorManagement/lib/models/azureAsyncOperationResult.js b/lib/services/frontdoorManagement/lib/models/azureAsyncOperationResult.js new file mode 100644 index 0000000000..4870803217 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/azureAsyncOperationResult.js @@ -0,0 +1,75 @@ +/* + * 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 response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + * + */ +class AzureAsyncOperationResult { + /** + * Create a AzureAsyncOperationResult. + * @member {string} [status] Status of the Azure async operation. Possible + * values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values + * include: 'InProgress', 'Succeeded', 'Failed' + * @member {object} [error] + * @member {string} [error.code] + * @member {string} [error.message] + * @member {string} [error.target] + * @member {array} [error.details] + * @member {string} [error.innerError] + */ + constructor() { + } + + /** + * Defines the metadata of AzureAsyncOperationResult + * + * @returns {object} metadata of AzureAsyncOperationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureAsyncOperationResult', + type: { + name: 'Composite', + className: 'AzureAsyncOperationResult', + modelProperties: { + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + error: { + required: false, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ErrorModel' + } + } + } + } + }; + } +} + +module.exports = AzureAsyncOperationResult; diff --git a/lib/services/frontdoorManagement/lib/models/azureManagedOverrideRuleGroup.js b/lib/services/frontdoorManagement/lib/models/azureManagedOverrideRuleGroup.js new file mode 100644 index 0000000000..57d51bc2ad --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/azureManagedOverrideRuleGroup.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Defines contents of a web application rule + * + */ +class AzureManagedOverrideRuleGroup { + /** + * Create a AzureManagedOverrideRuleGroup. + * @member {string} ruleGroupOverride Describes overrideruleGroup. Possible + * values include: 'SqlInjection', 'XSS' + * @member {string} action Type of Actions. Possible values include: 'Allow', + * 'Block', 'Log' + */ + constructor() { + } + + /** + * Defines the metadata of AzureManagedOverrideRuleGroup + * + * @returns {object} metadata of AzureManagedOverrideRuleGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureManagedOverrideRuleGroup', + type: { + name: 'Composite', + className: 'AzureManagedOverrideRuleGroup', + modelProperties: { + ruleGroupOverride: { + required: true, + serializedName: 'ruleGroupOverride', + type: { + name: 'String' + } + }, + action: { + required: true, + serializedName: 'action', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureManagedOverrideRuleGroup; diff --git a/lib/services/frontdoorManagement/lib/models/azureManagedRuleSet.js b/lib/services/frontdoorManagement/lib/models/azureManagedRuleSet.js new file mode 100644 index 0000000000..97b5305923 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/azureManagedRuleSet.js @@ -0,0 +1,92 @@ +/* + * 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'); + +/** + * Describes azure managed provider. + * + * @extends models['ManagedRuleSet'] + */ +class AzureManagedRuleSet extends models['ManagedRuleSet'] { + /** + * Create a AzureManagedRuleSet. + * @member {array} [ruleGroupOverrides] List of azure managed provider + * override configuration (optional) + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureManagedRuleSet + * + * @returns {object} metadata of AzureManagedRuleSet + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureManagedRuleSet', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ruleSetType', + clientName: 'ruleSetType' + }, + uberParent: 'ManagedRuleSet', + className: 'AzureManagedRuleSet', + modelProperties: { + priority: { + required: false, + serializedName: 'priority', + type: { + name: 'Number' + } + }, + version: { + required: false, + serializedName: 'version', + type: { + name: 'Number' + } + }, + ruleSetType: { + required: true, + serializedName: 'ruleSetType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + ruleGroupOverrides: { + required: false, + serializedName: 'ruleGroupOverrides', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureManagedOverrideRuleGroupElementType', + type: { + name: 'Composite', + className: 'AzureManagedOverrideRuleGroup' + } + } + } + } + } + } + }; + } +} + +module.exports = AzureManagedRuleSet; diff --git a/lib/services/frontdoorManagement/lib/models/backend.js b/lib/services/frontdoorManagement/lib/models/backend.js new file mode 100644 index 0000000000..a20e8a4083 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/backend.js @@ -0,0 +1,125 @@ +/* + * 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'; + +/** + * Backend address of a frontDoor load balancer. + * + */ +class Backend { + /** + * Create a Backend. + * @member {string} [address] Location of the backend (IP address or FQDN) + * @member {number} [httpPort] The HTTP TCP port number. Must be between 1 + * and 65535. + * @member {number} [httpsPort] The HTTPS TCP port number. Must be between 1 + * and 65535. + * @member {string} [enabledState] Whether to enable use of this backend. + * Permitted values are 'Enabled' or 'Disabled'. Possible values include: + * 'Enabled', 'Disabled' + * @member {number} [priority] Priority to use for load balancing. Higher + * priorities will not be used for load balancing if any lower priority + * backend is healthy. + * @member {number} [weight] Weight of this endpoint for load balancing + * purposes. + * @member {string} [backendHostHeader] The value to use as the host header + * sent to the backend. If blank or unspecified, this defaults to the + * incoming host. + */ + constructor() { + } + + /** + * Defines the metadata of Backend + * + * @returns {object} metadata of Backend + * + */ + mapper() { + return { + required: false, + serializedName: 'Backend', + type: { + name: 'Composite', + className: 'Backend', + modelProperties: { + address: { + required: false, + serializedName: 'address', + type: { + name: 'String' + } + }, + httpPort: { + required: false, + serializedName: 'httpPort', + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + httpsPort: { + required: false, + serializedName: 'httpsPort', + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + enabledState: { + required: false, + serializedName: 'enabledState', + type: { + name: 'String' + } + }, + priority: { + required: false, + serializedName: 'priority', + constraints: { + InclusiveMaximum: 5, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + weight: { + required: false, + serializedName: 'weight', + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + backendHostHeader: { + required: false, + serializedName: 'backendHostHeader', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Backend; diff --git a/lib/services/frontdoorManagement/lib/models/backendPool.js b/lib/services/frontdoorManagement/lib/models/backendPool.js new file mode 100644 index 0000000000..f7ff8a02f2 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/backendPool.js @@ -0,0 +1,119 @@ +/* + * 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 backend pool is a collection of backends that can be routed to. + * + * @extends models['SubResource'] + */ +class BackendPool extends models['SubResource'] { + /** + * Create a BackendPool. + * @member {array} [backends] The set of backends for this pool + * @member {object} [loadBalancingSettings] Load balancing settings for a + * backend pool + * @member {string} [loadBalancingSettings.id] Resource ID. + * @member {object} [healthProbeSettings] L7 health probe settings for a + * backend pool + * @member {string} [healthProbeSettings.id] Resource ID. + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BackendPool + * + * @returns {object} metadata of BackendPool + * + */ + mapper() { + return { + required: false, + serializedName: 'BackendPool', + type: { + name: 'Composite', + className: 'BackendPool', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + backends: { + required: false, + serializedName: 'properties.backends', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackendElementType', + type: { + name: 'Composite', + className: 'Backend' + } + } + } + }, + loadBalancingSettings: { + required: false, + serializedName: 'properties.loadBalancingSettings', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + healthProbeSettings: { + required: false, + serializedName: 'properties.healthProbeSettings', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + resourceState: { + required: false, + serializedName: 'properties.resourceState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackendPool; diff --git a/lib/services/frontdoorManagement/lib/models/backendPoolListResult.js b/lib/services/frontdoorManagement/lib/models/backendPoolListResult.js new file mode 100644 index 0000000000..4d77352f50 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/backendPoolListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Result of the request to list Backend Pools. It contains a list of Backend + * Pools objects and a URL link to get the the next set of results. + */ +class BackendPoolListResult extends Array { + /** + * Create a BackendPoolListResult. + * @member {string} [nextLink] URL to get the next set of BackendPool objects + * if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BackendPoolListResult + * + * @returns {object} metadata of BackendPoolListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BackendPoolListResult', + type: { + name: 'Composite', + className: 'BackendPoolListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackendPoolElementType', + type: { + name: 'Composite', + className: 'BackendPool' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackendPoolListResult; diff --git a/lib/services/frontdoorManagement/lib/models/backendPoolUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/backendPoolUpdateParameters.js new file mode 100644 index 0000000000..f812b39aa7 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/backendPoolUpdateParameters.js @@ -0,0 +1,82 @@ +/* + * 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'; + +/** + * A collection of backends that can be routed to. + * + */ +class BackendPoolUpdateParameters { + /** + * Create a BackendPoolUpdateParameters. + * @member {array} [backends] The set of backends for this pool + * @member {object} [loadBalancingSettings] Load balancing settings for a + * backend pool + * @member {string} [loadBalancingSettings.id] Resource ID. + * @member {object} [healthProbeSettings] L7 health probe settings for a + * backend pool + * @member {string} [healthProbeSettings.id] Resource ID. + */ + constructor() { + } + + /** + * Defines the metadata of BackendPoolUpdateParameters + * + * @returns {object} metadata of BackendPoolUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'BackendPoolUpdateParameters', + type: { + name: 'Composite', + className: 'BackendPoolUpdateParameters', + modelProperties: { + backends: { + required: false, + serializedName: 'backends', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackendElementType', + type: { + name: 'Composite', + className: 'Backend' + } + } + } + }, + loadBalancingSettings: { + required: false, + serializedName: 'loadBalancingSettings', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + healthProbeSettings: { + required: false, + serializedName: 'healthProbeSettings', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + } + }; + } +} + +module.exports = BackendPoolUpdateParameters; diff --git a/lib/services/frontdoorManagement/lib/models/cacheConfiguration.js b/lib/services/frontdoorManagement/lib/models/cacheConfiguration.js new file mode 100644 index 0000000000..198afe5622 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/cacheConfiguration.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Caching settings for a caching-type route. To disable caching, do not + * provide a cacheConfiguration object. + * + */ +class CacheConfiguration { + /** + * Create a CacheConfiguration. + * @member {string} [queryParameterStripDirective] Treatment of URL query + * terms when forming the cache key. Possible values include: 'StripNone', + * 'StripAll' + * @member {string} [dynamicCompression] Whether to use dynamic compression + * for cached content. Possible values include: 'Enabled', 'Disabled' + */ + constructor() { + } + + /** + * Defines the metadata of CacheConfiguration + * + * @returns {object} metadata of CacheConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'CacheConfiguration', + type: { + name: 'Composite', + className: 'CacheConfiguration', + modelProperties: { + queryParameterStripDirective: { + required: false, + serializedName: 'queryParameterStripDirective', + type: { + name: 'String' + } + }, + dynamicCompression: { + required: false, + serializedName: 'dynamicCompression', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CacheConfiguration; diff --git a/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityInput.js b/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityInput.js new file mode 100644 index 0000000000..a3108083d2 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityInput.js @@ -0,0 +1,63 @@ +/* + * 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'; + +/** + * Input of CheckNameAvailability API. + * + */ +class CheckNameAvailabilityInput { + /** + * Create a CheckNameAvailabilityInput. + * @member {string} name The resource name to validate. + * @member {string} type The type of the resource whose name is to be + * validated. Possible values include: 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + */ + constructor() { + } + + /** + * Defines the metadata of CheckNameAvailabilityInput + * + * @returns {object} metadata of CheckNameAvailabilityInput + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckNameAvailabilityInput', + type: { + name: 'Composite', + className: 'CheckNameAvailabilityInput', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'Microsoft.Network/frontDoors', 'Microsoft.Network/frontDoors/frontendEndpoints' ] + } + } + } + } + }; + } +} + +module.exports = CheckNameAvailabilityInput; diff --git a/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityOutput.js b/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityOutput.js new file mode 100644 index 0000000000..7699b34c79 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityOutput.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * Output of check name availability API. + * + */ +class CheckNameAvailabilityOutput { + /** + * Create a CheckNameAvailabilityOutput. + * @member {string} [nameAvailability] Indicates whether the name is + * available. Possible values include: 'Available', 'Unavailable' + * @member {string} [reason] The reason why the name is not available. + * @member {string} [message] The detailed error message describing why the + * name is not available. + */ + constructor() { + } + + /** + * Defines the metadata of CheckNameAvailabilityOutput + * + * @returns {object} metadata of CheckNameAvailabilityOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckNameAvailabilityOutput', + type: { + name: 'Composite', + className: 'CheckNameAvailabilityOutput', + modelProperties: { + nameAvailability: { + required: false, + readOnly: true, + serializedName: 'nameAvailability', + type: { + name: 'String' + } + }, + reason: { + required: false, + readOnly: true, + serializedName: 'reason', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CheckNameAvailabilityOutput; diff --git a/lib/services/frontdoorManagement/lib/models/customHttpsConfiguration.js b/lib/services/frontdoorManagement/lib/models/customHttpsConfiguration.js new file mode 100644 index 0000000000..6efe7fe9fe --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/customHttpsConfiguration.js @@ -0,0 +1,100 @@ +/* + * 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'; + +/** + * Https settings for a domain + * + */ +class CustomHttpsConfiguration { + /** + * Create a CustomHttpsConfiguration. + * @member {string} [certificateSource] Defines the source of the SSL + * certificate. Possible values include: 'AzureKeyVault', 'FrontDoor' + * @member {string} [protocolType] Defines the TLS extension protocol that is + * used for secure delivery. Possible values include: 'ServerNameIndication' + * @member {object} [vault] The Key Vault containing the SSL certificate + * @member {string} [vault.id] Resource ID. + * @member {string} [secretName] The name of the Key Vault secret + * representing the full certificate PFX + * @member {string} [secretVersion] The version of the Key Vault secret + * representing the full certificate PFX + * @member {string} [certificateType] Defines the type of the certificate + * used for secure connections to a frontendEndpoint. Possible values + * include: 'Dedicated' + */ + constructor() { + } + + /** + * Defines the metadata of CustomHttpsConfiguration + * + * @returns {object} metadata of CustomHttpsConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'CustomHttpsConfiguration', + type: { + name: 'Composite', + className: 'CustomHttpsConfiguration', + modelProperties: { + certificateSource: { + required: false, + serializedName: 'certificateSource', + type: { + name: 'String' + } + }, + protocolType: { + required: false, + serializedName: 'protocolType', + type: { + name: 'String' + } + }, + vault: { + required: false, + serializedName: 'keyVaultCertificateSourceParameters.vault', + type: { + name: 'Composite', + className: 'KeyVaultCertificateSourceParametersVault' + } + }, + secretName: { + required: false, + serializedName: 'keyVaultCertificateSourceParameters.secretName', + type: { + name: 'String' + } + }, + secretVersion: { + required: false, + serializedName: 'keyVaultCertificateSourceParameters.secretVersion', + type: { + name: 'String' + } + }, + certificateType: { + required: false, + serializedName: 'frontDoorCertificateSourceParameters.certificateType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CustomHttpsConfiguration; diff --git a/lib/services/frontdoorManagement/lib/models/customRule.js b/lib/services/frontdoorManagement/lib/models/customRule.js new file mode 100644 index 0000000000..1276b3f49a --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/customRule.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'; + +/** + * Defines contents of a web application rule + * + */ +class CustomRule { + /** + * Create a CustomRule. + * @member {string} [name] Gets name of the resource that is unique within a + * policy. This name can be used to access the resource. + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + * @member {number} priority Describes priority of the rule. Rules with a + * lower value will be evaluated before rules with a higher value + * @member {string} ruleType Describes type of rule. Possible values include: + * 'MatchRule', 'RateLimitRule' + * @member {number} [rateLimitDurationInMinutes] Defines rate limit duration. + * Default - 1 minute + * @member {number} [rateLimitThreshold] Defines rate limit thresold + * @member {array} matchConditions List of match conditions + * @member {string} action Type of Actions. Possible values include: 'Allow', + * 'Block', 'Log' + * @member {array} [transforms] List of transforms + */ + constructor() { + } + + /** + * Defines the metadata of CustomRule + * + * @returns {object} metadata of CustomRule + * + */ + mapper() { + return { + required: false, + serializedName: 'CustomRule', + type: { + name: 'Composite', + className: 'CustomRule', + modelProperties: { + name: { + required: false, + serializedName: 'name', + constraints: { + MaxLength: 128 + }, + type: { + name: 'String' + } + }, + etag: { + required: false, + readOnly: true, + serializedName: 'etag', + type: { + name: 'String' + } + }, + priority: { + required: true, + serializedName: 'priority', + type: { + name: 'Number' + } + }, + ruleType: { + required: true, + serializedName: 'ruleType', + type: { + name: 'String' + } + }, + rateLimitDurationInMinutes: { + required: false, + serializedName: 'rateLimitDurationInMinutes', + type: { + name: 'Number' + } + }, + rateLimitThreshold: { + required: false, + serializedName: 'rateLimitThreshold', + type: { + name: 'Number' + } + }, + matchConditions: { + required: true, + serializedName: 'matchConditions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MatchCondition1ElementType', + type: { + name: 'Composite', + className: 'MatchCondition1' + } + } + } + }, + action: { + required: true, + serializedName: 'action', + type: { + name: 'String' + } + }, + transforms: { + required: false, + serializedName: 'transforms', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TransformElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CustomRule; diff --git a/lib/services/frontdoorManagement/lib/models/customRules.js b/lib/services/frontdoorManagement/lib/models/customRules.js new file mode 100644 index 0000000000..90cbc888df --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/customRules.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Defines contents of custom rules + * + */ +class CustomRules { + /** + * Create a CustomRules. + * @member {array} [rules] List of rules + */ + constructor() { + } + + /** + * Defines the metadata of CustomRules + * + * @returns {object} metadata of CustomRules + * + */ + mapper() { + return { + required: false, + serializedName: 'CustomRules', + type: { + name: 'Composite', + className: 'CustomRules', + modelProperties: { + rules: { + required: false, + serializedName: 'rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CustomRuleElementType', + type: { + name: 'Composite', + className: 'CustomRule' + } + } + } + } + } + } + }; + } +} + +module.exports = CustomRules; diff --git a/lib/services/frontdoorManagement/lib/models/errorDetails.js b/lib/services/frontdoorManagement/lib/models/errorDetails.js new file mode 100644 index 0000000000..fcac88503a --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/errorDetails.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a ErrorDetails. + */ +class ErrorDetails { + /** + * Create a ErrorDetails. + * @member {string} [code] + * @member {string} [target] + * @member {string} [message] + */ + constructor() { + } + + /** + * Defines the metadata of ErrorDetails + * + * @returns {object} metadata of ErrorDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorDetails', + type: { + name: 'Composite', + className: 'ErrorDetails', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorDetails; diff --git a/lib/services/frontdoorManagement/lib/models/errorModel.js b/lib/services/frontdoorManagement/lib/models/errorModel.js new file mode 100644 index 0000000000..955cde1528 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/errorModel.js @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a ErrorModel. + */ +class ErrorModel { + /** + * Create a ErrorModel. + * @member {string} [code] + * @member {string} [message] + * @member {string} [target] + * @member {array} [details] + * @member {string} [innerError] + */ + constructor() { + } + + /** + * Defines the metadata of ErrorModel + * + * @returns {object} metadata of ErrorModel + * + */ + mapper() { + return { + required: false, + serializedName: 'Error', + type: { + name: 'Composite', + className: 'ErrorModel', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + details: { + required: false, + serializedName: 'details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ErrorDetailsElementType', + type: { + name: 'Composite', + className: 'ErrorDetails' + } + } + } + }, + innerError: { + required: false, + serializedName: 'innerError', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorModel; diff --git a/lib/services/frontdoorManagement/lib/models/errorResponse.js b/lib/services/frontdoorManagement/lib/models/errorResponse.js new file mode 100644 index 0000000000..f7411b7340 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/errorResponse.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Error reponse indicates Front Door service is not able to process the + * incoming request. The reason is provided in the error message. + * + */ +class ErrorResponse { + /** + * Create a ErrorResponse. + * @member {string} [code] Error code. + * @member {string} [message] Error message indicating why the operation + * failed. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorResponse + * + * @returns {object} metadata of ErrorResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorResponse', + type: { + name: 'Composite', + className: 'ErrorResponse', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorResponse; diff --git a/lib/services/frontdoorManagement/lib/models/frontDoor.js b/lib/services/frontdoorManagement/lib/models/frontDoor.js new file mode 100644 index 0000000000..90c3366037 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/frontDoor.js @@ -0,0 +1,225 @@ +/* + * 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'); + +/** + * Front Door represents a collection of backend endpoints to route traffic to + * along with rules that specify how traffic is sent there. + * + * @extends models['Resource'] + */ +class FrontDoor extends models['Resource'] { + /** + * Create a FrontDoor. + * @member {string} [friendlyName] A friendly name for the frontDoor + * @member {array} [routingRules] Routing rules associated with this Front + * Door. + * @member {array} [loadBalancingSettings] Load balancing settings associated + * with this Front Door instance. + * @member {array} [healthProbeSettings] Health probe settings associated + * with this Front Door instance. + * @member {array} [backendPools] Backend pools available to routing rules. + * @member {array} [frontendEndpoints] Frontend endpoints available to + * routing rules. + * @member {string} [enabledState] Operational status of the Front Door load + * balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * @member {string} [resourceState] Resource status of the Front Door. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * @member {string} [provisioningState] Provisioning state of the Front Door. + * @member {string} [cname] The host that each frontendEndpoint must CNAME + * to. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FrontDoor + * + * @returns {object} metadata of FrontDoor + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontDoor', + type: { + name: 'Composite', + className: 'FrontDoor', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + friendlyName: { + required: false, + serializedName: 'properties.friendlyName', + type: { + name: 'String' + } + }, + routingRules: { + required: false, + serializedName: 'properties.routingRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RoutingRuleElementType', + type: { + name: 'Composite', + className: 'RoutingRule' + } + } + } + }, + loadBalancingSettings: { + required: false, + serializedName: 'properties.loadBalancingSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LoadBalancingSettingsModelElementType', + type: { + name: 'Composite', + className: 'LoadBalancingSettingsModel' + } + } + } + }, + healthProbeSettings: { + required: false, + serializedName: 'properties.healthProbeSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HealthProbeSettingsModelElementType', + type: { + name: 'Composite', + className: 'HealthProbeSettingsModel' + } + } + } + }, + backendPools: { + required: false, + serializedName: 'properties.backendPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackendPoolElementType', + type: { + name: 'Composite', + className: 'BackendPool' + } + } + } + }, + frontendEndpoints: { + required: false, + serializedName: 'properties.frontendEndpoints', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontendEndpointElementType', + type: { + name: 'Composite', + className: 'FrontendEndpoint' + } + } + } + }, + enabledState: { + required: false, + serializedName: 'properties.enabledState', + type: { + name: 'String' + } + }, + resourceState: { + required: false, + serializedName: 'properties.resourceState', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + cname: { + required: false, + readOnly: true, + serializedName: 'properties.cname', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FrontDoor; diff --git a/lib/services/frontdoorManagement/lib/models/frontDoorListResult.js b/lib/services/frontdoorManagement/lib/models/frontDoorListResult.js new file mode 100644 index 0000000000..d719fd6e2e --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/frontDoorListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Result of the request to list Front Doors. It contains a list of Front Door + * objects and a URL link to get the the next set of results. + */ +class FrontDoorListResult extends Array { + /** + * Create a FrontDoorListResult. + * @member {string} [nextLink] URL to get the next set of Front Door objects + * if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FrontDoorListResult + * + * @returns {object} metadata of FrontDoorListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontDoorListResult', + type: { + name: 'Composite', + className: 'FrontDoorListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontDoorElementType', + type: { + name: 'Composite', + className: 'FrontDoor' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FrontDoorListResult; diff --git a/lib/services/frontdoorManagement/lib/models/frontDoorUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/frontDoorUpdateParameters.js new file mode 100644 index 0000000000..f6dd2a0426 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/frontDoorUpdateParameters.js @@ -0,0 +1,146 @@ +/* + * 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 properties needed to update a Front Door + * + */ +class FrontDoorUpdateParameters { + /** + * Create a FrontDoorUpdateParameters. + * @member {string} [friendlyName] A friendly name for the frontDoor + * @member {array} [routingRules] Routing rules associated with this Front + * Door. + * @member {array} [loadBalancingSettings] Load balancing settings associated + * with this Front Door instance. + * @member {array} [healthProbeSettings] Health probe settings associated + * with this Front Door instance. + * @member {array} [backendPools] Backend pools available to routing rules. + * @member {array} [frontendEndpoints] Frontend endpoints available to + * routing rules. + * @member {string} [enabledState] Operational status of the Front Door load + * balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + */ + constructor() { + } + + /** + * Defines the metadata of FrontDoorUpdateParameters + * + * @returns {object} metadata of FrontDoorUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontDoorUpdateParameters', + type: { + name: 'Composite', + className: 'FrontDoorUpdateParameters', + modelProperties: { + friendlyName: { + required: false, + serializedName: 'friendlyName', + type: { + name: 'String' + } + }, + routingRules: { + required: false, + serializedName: 'routingRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RoutingRuleElementType', + type: { + name: 'Composite', + className: 'RoutingRule' + } + } + } + }, + loadBalancingSettings: { + required: false, + serializedName: 'loadBalancingSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LoadBalancingSettingsModelElementType', + type: { + name: 'Composite', + className: 'LoadBalancingSettingsModel' + } + } + } + }, + healthProbeSettings: { + required: false, + serializedName: 'healthProbeSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HealthProbeSettingsModelElementType', + type: { + name: 'Composite', + className: 'HealthProbeSettingsModel' + } + } + } + }, + backendPools: { + required: false, + serializedName: 'backendPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackendPoolElementType', + type: { + name: 'Composite', + className: 'BackendPool' + } + } + } + }, + frontendEndpoints: { + required: false, + serializedName: 'frontendEndpoints', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontendEndpointElementType', + type: { + name: 'Composite', + className: 'FrontendEndpoint' + } + } + } + }, + enabledState: { + required: false, + serializedName: 'enabledState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FrontDoorUpdateParameters; diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpoint.js b/lib/services/frontdoorManagement/lib/models/frontendEndpoint.js new file mode 100644 index 0000000000..d4cd4f4d82 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpoint.js @@ -0,0 +1,175 @@ +/* + * 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 frontend endpoint used for routing. + * + * @extends models['SubResource'] + */ +class FrontendEndpoint extends models['SubResource'] { + /** + * Create a FrontendEndpoint. + * @member {string} [hostName] The host name of the frontendEndpoint. Must be + * a domain name. + * @member {string} [sessionAffinityEnabledState] Whether to allow session + * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' + * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be + * ignored. The TTL to use in seconds for session affinity, if applicable. + * @member {object} [webApplicationFirewallPolicyLink] Defines the Web + * Application Firewall policy for each host (if applicable) + * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID. + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [customHttpsProvisioningState] Provisioning status of + * Custom Https of the frontendEndpoint. Possible values include: 'Enabling', + * 'Enabled', 'Disabling', 'Disabled', 'Failed' + * @member {string} [customHttpsProvisioningSubstate] Provisioning substate + * shows the progress of custom HTTPS enabling/disabling process step by + * step. Possible values include: 'SubmittingDomainControlValidationRequest', + * 'PendingDomainControlValidationREquestApproval', + * 'DomainControlValidationRequestApproved', + * 'DomainControlValidationRequestRejected', + * 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', + * 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + * 'CertificateDeleted' + * @member {object} [customHttpsConfiguration] The configuration specifying + * how to enable HTTPS + * @member {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * @member {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * @member {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * @member {string} [customHttpsConfiguration.vault.id] Resource ID. + * @member {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * @member {string} [customHttpsConfiguration.secretVersion] The version of + * the Key Vault secret representing the full certificate PFX + * @member {string} [customHttpsConfiguration.certificateType] Defines the + * type of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FrontendEndpoint + * + * @returns {object} metadata of FrontendEndpoint + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontendEndpoint', + type: { + name: 'Composite', + className: 'FrontendEndpoint', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + hostName: { + required: false, + serializedName: 'properties.hostName', + type: { + name: 'String' + } + }, + sessionAffinityEnabledState: { + required: false, + serializedName: 'properties.sessionAffinityEnabledState', + type: { + name: 'String' + } + }, + sessionAffinityTtlSeconds: { + required: false, + serializedName: 'properties.sessionAffinityTtlSeconds', + type: { + name: 'Number' + } + }, + webApplicationFirewallPolicyLink: { + required: false, + serializedName: 'properties.webApplicationFirewallPolicyLink', + type: { + name: 'Composite', + className: 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink' + } + }, + resourceState: { + required: false, + serializedName: 'properties.resourceState', + type: { + name: 'String' + } + }, + customHttpsProvisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.customHttpsProvisioningState', + type: { + name: 'String' + } + }, + customHttpsProvisioningSubstate: { + required: false, + readOnly: true, + serializedName: 'properties.customHttpsProvisioningSubstate', + type: { + name: 'String' + } + }, + customHttpsConfiguration: { + required: false, + readOnly: true, + serializedName: 'properties.customHttpsConfiguration', + type: { + name: 'Composite', + className: 'CustomHttpsConfiguration' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FrontendEndpoint; diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParameters.js new file mode 100644 index 0000000000..4661f6aed1 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParameters.js @@ -0,0 +1,83 @@ +/* + * 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'; + +/** + * Frontend endpoint used in routing rule + * + */ +class FrontendEndpointUpdateParameters { + /** + * Create a FrontendEndpointUpdateParameters. + * @member {string} [hostName] The host name of the frontendEndpoint. Must be + * a domain name. + * @member {string} [sessionAffinityEnabledState] Whether to allow session + * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' + * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be + * ignored. The TTL to use in seconds for session affinity, if applicable. + * @member {object} [webApplicationFirewallPolicyLink] Defines the Web + * Application Firewall policy for each host (if applicable) + * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID. + */ + constructor() { + } + + /** + * Defines the metadata of FrontendEndpointUpdateParameters + * + * @returns {object} metadata of FrontendEndpointUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontendEndpointUpdateParameters', + type: { + name: 'Composite', + className: 'FrontendEndpointUpdateParameters', + modelProperties: { + hostName: { + required: false, + serializedName: 'hostName', + type: { + name: 'String' + } + }, + sessionAffinityEnabledState: { + required: false, + serializedName: 'sessionAffinityEnabledState', + type: { + name: 'String' + } + }, + sessionAffinityTtlSeconds: { + required: false, + serializedName: 'sessionAffinityTtlSeconds', + type: { + name: 'Number' + } + }, + webApplicationFirewallPolicyLink: { + required: false, + serializedName: 'webApplicationFirewallPolicyLink', + type: { + name: 'Composite', + className: 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink' + } + } + } + } + }; + } +} + +module.exports = FrontendEndpointUpdateParameters; diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.js b/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.js new file mode 100644 index 0000000000..3fa1e51455 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Defines the Web Application Firewall policy for each host (if applicable) + * + */ +class FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink { + /** + * Create a FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink. + * @member {string} [id] Resource ID. + */ + constructor() { + } + + /** + * Defines the metadata of FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + * + * @returns {object} metadata of FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontendEndpointUpdateParameters_webApplicationFirewallPolicyLink', + type: { + name: 'Composite', + className: 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink; diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpointsListResult.js b/lib/services/frontdoorManagement/lib/models/frontendEndpointsListResult.js new file mode 100644 index 0000000000..381bdce9c5 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpointsListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Result of the request to list frontend endpoints. It contains a list of + * Frontend endpoint objects and a URL link to get the the next set of results. + */ +class FrontendEndpointsListResult extends Array { + /** + * Create a FrontendEndpointsListResult. + * @member {string} [nextLink] URL to get the next set of frontend endpoints + * if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FrontendEndpointsListResult + * + * @returns {object} metadata of FrontendEndpointsListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontendEndpointsListResult', + type: { + name: 'Composite', + className: 'FrontendEndpointsListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontendEndpointElementType', + type: { + name: 'Composite', + className: 'FrontendEndpoint' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FrontendEndpointsListResult; diff --git a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsListResult.js b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsListResult.js new file mode 100644 index 0000000000..6449669558 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsListResult.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Result of the request to list HealthProbeSettings. It contains a list of + * HealthProbeSettings objects and a URL link to get the the next set of + * results. + */ +class HealthProbeSettingsListResult extends Array { + /** + * Create a HealthProbeSettingsListResult. + * @member {string} [nextLink] URL to get the next set of HealthProbeSettings + * objects if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HealthProbeSettingsListResult + * + * @returns {object} metadata of HealthProbeSettingsListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'HealthProbeSettingsListResult', + type: { + name: 'Composite', + className: 'HealthProbeSettingsListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HealthProbeSettingsModelElementType', + type: { + name: 'Composite', + className: 'HealthProbeSettingsModel' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HealthProbeSettingsListResult; diff --git a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsModel.js b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsModel.js new file mode 100644 index 0000000000..551e3d35b2 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsModel.js @@ -0,0 +1,107 @@ +/* + * 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'); + +/** + * Load balancing settings for a backend pool + * + * @extends models['SubResource'] + */ +class HealthProbeSettingsModel extends models['SubResource'] { + /** + * Create a HealthProbeSettingsModel. + * @member {string} [path] The path to use for the health probe. Default is / + * @member {string} [protocol] Protocol scheme to use for this probe. + * Possible values include: 'Http', 'Https' + * @member {number} [intervalInSeconds] The number of seconds between health + * probes. + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HealthProbeSettingsModel + * + * @returns {object} metadata of HealthProbeSettingsModel + * + */ + mapper() { + return { + required: false, + serializedName: 'HealthProbeSettingsModel', + type: { + name: 'Composite', + className: 'HealthProbeSettingsModel', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + path: { + required: false, + serializedName: 'properties.path', + type: { + name: 'String' + } + }, + protocol: { + required: false, + serializedName: 'properties.protocol', + type: { + name: 'String' + } + }, + intervalInSeconds: { + required: false, + serializedName: 'properties.intervalInSeconds', + type: { + name: 'Number' + } + }, + resourceState: { + required: false, + serializedName: 'properties.resourceState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HealthProbeSettingsModel; diff --git a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsUpdateParameters.js new file mode 100644 index 0000000000..6c87904add --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsUpdateParameters.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * L7 health probe settings for a backend pool + * + */ +class HealthProbeSettingsUpdateParameters { + /** + * Create a HealthProbeSettingsUpdateParameters. + * @member {string} [path] The path to use for the health probe. Default is / + * @member {string} [protocol] Protocol scheme to use for this probe. + * Possible values include: 'Http', 'Https' + * @member {number} [intervalInSeconds] The number of seconds between health + * probes. + */ + constructor() { + } + + /** + * Defines the metadata of HealthProbeSettingsUpdateParameters + * + * @returns {object} metadata of HealthProbeSettingsUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'HealthProbeSettingsUpdateParameters', + type: { + name: 'Composite', + className: 'HealthProbeSettingsUpdateParameters', + modelProperties: { + path: { + required: false, + serializedName: 'path', + type: { + name: 'String' + } + }, + protocol: { + required: false, + serializedName: 'protocol', + type: { + name: 'String' + } + }, + intervalInSeconds: { + required: false, + serializedName: 'intervalInSeconds', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = HealthProbeSettingsUpdateParameters; diff --git a/lib/services/frontdoorManagement/lib/models/index.d.ts b/lib/services/frontdoorManagement/lib/models/index.d.ts new file mode 100644 index 0000000000..78bf28e1b7 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/index.d.ts @@ -0,0 +1,982 @@ +/* + * 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 Resource class. + * @constructor + * Common resource representation. + * + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [location] Resource location. + * @member {object} [tags] Resource tags. + */ +export interface Resource extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; + location?: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the FrontDoor class. + * @constructor + * Front Door represents a collection of backend endpoints to route traffic to + * along with rules that specify how traffic is sent there. + * + * @member {string} [friendlyName] A friendly name for the frontDoor + * @member {array} [routingRules] Routing rules associated with this Front + * Door. + * @member {array} [loadBalancingSettings] Load balancing settings associated + * with this Front Door instance. + * @member {array} [healthProbeSettings] Health probe settings associated with + * this Front Door instance. + * @member {array} [backendPools] Backend pools available to routing rules. + * @member {array} [frontendEndpoints] Frontend endpoints available to routing + * rules. + * @member {string} [enabledState] Operational status of the Front Door load + * balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * @member {string} [resourceState] Resource status of the Front Door. Possible + * values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + * 'Deleting' + * @member {string} [provisioningState] Provisioning state of the Front Door. + * @member {string} [cname] The host that each frontendEndpoint must CNAME to. + */ +export interface FrontDoor extends Resource { + friendlyName?: string; + routingRules?: RoutingRule[]; + loadBalancingSettings?: LoadBalancingSettingsModel[]; + healthProbeSettings?: HealthProbeSettingsModel[]; + backendPools?: BackendPool[]; + frontendEndpoints?: FrontendEndpoint[]; + enabledState?: string; + resourceState?: string; + readonly provisioningState?: string; + readonly cname?: string; +} + +/** + * @class + * Initializes a new instance of the SubResource class. + * @constructor + * Reference to another subresource. + * + * @member {string} [id] Resource ID. + */ +export interface SubResource extends BaseResource { + id?: string; +} + +/** + * @class + * Initializes a new instance of the RoutingRule class. + * @constructor + * A routing rule represents a specification for traffic to treat and where to + * send it, along with health probe information. + * + * @member {array} [frontendEndpoints] Frontend endpoints associated with this + * rule + * @member {array} [acceptedProtocols] Protocol schemes to match for this rule + * @member {array} [patternsToMatch] The route patterns of the rule. + * @member {string} [customForwardingPath] A custom path used to rewrite + * resource paths matched by this rule. Leave empty to use incoming path. + * @member {string} [forwardingProtocol] Protocol this rule will use when + * forwarding traffic to backends. Possible values include: 'HttpOnly', + * 'HttpsOnly', 'MatchRequest' + * @member {object} [cacheConfiguration] The caching configuration associated + * with this rule. + * @member {string} [cacheConfiguration.queryParameterStripDirective] Treatment + * of URL query terms when forming the cache key. Possible values include: + * 'StripNone', 'StripAll' + * @member {string} [cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * @member {object} [backendPool] A reference to the BackendPool which this + * rule routes to. + * @member {string} [backendPool.id] Resource ID. + * @member {string} [enabledState] Whether to enable use of this rule. + * Permitted values are 'Enabled' or 'Disabled'. Possible values include: + * 'Enabled', 'Disabled' + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ +export interface RoutingRule extends SubResource { + frontendEndpoints?: SubResource[]; + acceptedProtocols?: string[]; + patternsToMatch?: string[]; + customForwardingPath?: string; + forwardingProtocol?: string; + cacheConfiguration?: CacheConfiguration; + backendPool?: SubResource; + enabledState?: string; + resourceState?: string; + name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancingSettingsModel class. + * @constructor + * Load balancing settings for a backend pool + * + * @member {number} [sampleSize] The number of samples to consider for load + * balancing decisions + * @member {number} [successfulSamplesRequired] The number of samples within + * the sample period that must succeed + * @member {number} [additionalLatencyMilliseconds] The additional latency in + * milliseconds for probes to fall into the lowest latency bucket + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ +export interface LoadBalancingSettingsModel extends SubResource { + sampleSize?: number; + successfulSamplesRequired?: number; + additionalLatencyMilliseconds?: number; + resourceState?: string; + name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the HealthProbeSettingsModel class. + * @constructor + * Load balancing settings for a backend pool + * + * @member {string} [path] The path to use for the health probe. Default is / + * @member {string} [protocol] Protocol scheme to use for this probe. Possible + * values include: 'Http', 'Https' + * @member {number} [intervalInSeconds] The number of seconds between health + * probes. + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ +export interface HealthProbeSettingsModel extends SubResource { + path?: string; + protocol?: string; + intervalInSeconds?: number; + resourceState?: string; + name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the BackendPool class. + * @constructor + * A backend pool is a collection of backends that can be routed to. + * + * @member {array} [backends] The set of backends for this pool + * @member {object} [loadBalancingSettings] Load balancing settings for a + * backend pool + * @member {string} [loadBalancingSettings.id] Resource ID. + * @member {object} [healthProbeSettings] L7 health probe settings for a + * backend pool + * @member {string} [healthProbeSettings.id] Resource ID. + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ +export interface BackendPool extends SubResource { + backends?: Backend[]; + loadBalancingSettings?: SubResource; + healthProbeSettings?: SubResource; + resourceState?: string; + name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the KeyVaultCertificateSourceParametersVault class. + * @constructor + * The Key Vault containing the SSL certificate + * + * @member {string} [id] Resource ID. + */ +export interface KeyVaultCertificateSourceParametersVault { + id?: string; +} + +/** + * @class + * Initializes a new instance of the CustomHttpsConfiguration class. + * @constructor + * Https settings for a domain + * + * @member {string} [certificateSource] Defines the source of the SSL + * certificate. Possible values include: 'AzureKeyVault', 'FrontDoor' + * @member {string} [protocolType] Defines the TLS extension protocol that is + * used for secure delivery. Possible values include: 'ServerNameIndication' + * @member {object} [vault] The Key Vault containing the SSL certificate + * @member {string} [vault.id] Resource ID. + * @member {string} [secretName] The name of the Key Vault secret representing + * the full certificate PFX + * @member {string} [secretVersion] The version of the Key Vault secret + * representing the full certificate PFX + * @member {string} [certificateType] Defines the type of the certificate used + * for secure connections to a frontendEndpoint. Possible values include: + * 'Dedicated' + */ +export interface CustomHttpsConfiguration { + certificateSource?: string; + protocolType?: string; + vault?: KeyVaultCertificateSourceParametersVault; + secretName?: string; + secretVersion?: string; + certificateType?: string; +} + +/** + * @class + * Initializes a new instance of the FrontendEndpoint class. + * @constructor + * A frontend endpoint used for routing. + * + * @member {string} [hostName] The host name of the frontendEndpoint. Must be a + * domain name. + * @member {string} [sessionAffinityEnabledState] Whether to allow session + * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' + * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be + * ignored. The TTL to use in seconds for session affinity, if applicable. + * @member {object} [webApplicationFirewallPolicyLink] Defines the Web + * Application Firewall policy for each host (if applicable) + * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID. + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [customHttpsProvisioningState] Provisioning status of + * Custom Https of the frontendEndpoint. Possible values include: 'Enabling', + * 'Enabled', 'Disabling', 'Disabled', 'Failed' + * @member {string} [customHttpsProvisioningSubstate] Provisioning substate + * shows the progress of custom HTTPS enabling/disabling process step by step. + * Possible values include: 'SubmittingDomainControlValidationRequest', + * 'PendingDomainControlValidationREquestApproval', + * 'DomainControlValidationRequestApproved', + * 'DomainControlValidationRequestRejected', + * 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', + * 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + * 'CertificateDeleted' + * @member {object} [customHttpsConfiguration] The configuration specifying how + * to enable HTTPS + * @member {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * @member {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * @member {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * @member {string} [customHttpsConfiguration.vault.id] Resource ID. + * @member {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * @member {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * @member {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ +export interface FrontendEndpoint extends SubResource { + hostName?: string; + sessionAffinityEnabledState?: string; + sessionAffinityTtlSeconds?: number; + webApplicationFirewallPolicyLink?: FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink; + resourceState?: string; + readonly customHttpsProvisioningState?: string; + readonly customHttpsProvisioningSubstate?: string; + readonly customHttpsConfiguration?: CustomHttpsConfiguration; + name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the FrontDoorUpdateParameters class. + * @constructor + * The properties needed to update a Front Door + * + * @member {string} [friendlyName] A friendly name for the frontDoor + * @member {array} [routingRules] Routing rules associated with this Front + * Door. + * @member {array} [loadBalancingSettings] Load balancing settings associated + * with this Front Door instance. + * @member {array} [healthProbeSettings] Health probe settings associated with + * this Front Door instance. + * @member {array} [backendPools] Backend pools available to routing rules. + * @member {array} [frontendEndpoints] Frontend endpoints available to routing + * rules. + * @member {string} [enabledState] Operational status of the Front Door load + * balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + */ +export interface FrontDoorUpdateParameters { + friendlyName?: string; + routingRules?: RoutingRule[]; + loadBalancingSettings?: LoadBalancingSettingsModel[]; + healthProbeSettings?: HealthProbeSettingsModel[]; + backendPools?: BackendPool[]; + frontendEndpoints?: FrontendEndpoint[]; + enabledState?: string; +} + +/** + * @class + * Initializes a new instance of the PurgeParameters class. + * @constructor + * Parameters required for content purge. + * + * @member {array} contentPaths The path to the content to be purged. Can + * describe a file path or a wild card directory. + */ +export interface PurgeParameters { + contentPaths: string[]; +} + +/** + * @class + * Initializes a new instance of the CacheConfiguration class. + * @constructor + * Caching settings for a caching-type route. To disable caching, do not + * provide a cacheConfiguration object. + * + * @member {string} [queryParameterStripDirective] Treatment of URL query terms + * when forming the cache key. Possible values include: 'StripNone', 'StripAll' + * @member {string} [dynamicCompression] Whether to use dynamic compression for + * cached content. Possible values include: 'Enabled', 'Disabled' + */ +export interface CacheConfiguration { + queryParameterStripDirective?: string; + dynamicCompression?: string; +} + +/** + * @class + * Initializes a new instance of the RoutingRuleUpdateParameters class. + * @constructor + * Routing rules to apply to an endpoint + * + * @member {array} [frontendEndpoints] Frontend endpoints associated with this + * rule + * @member {array} [acceptedProtocols] Protocol schemes to match for this rule + * @member {array} [patternsToMatch] The route patterns of the rule. + * @member {string} [customForwardingPath] A custom path used to rewrite + * resource paths matched by this rule. Leave empty to use incoming path. + * @member {string} [forwardingProtocol] Protocol this rule will use when + * forwarding traffic to backends. Possible values include: 'HttpOnly', + * 'HttpsOnly', 'MatchRequest' + * @member {object} [cacheConfiguration] The caching configuration associated + * with this rule. + * @member {string} [cacheConfiguration.queryParameterStripDirective] Treatment + * of URL query terms when forming the cache key. Possible values include: + * 'StripNone', 'StripAll' + * @member {string} [cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * @member {object} [backendPool] A reference to the BackendPool which this + * rule routes to. + * @member {string} [backendPool.id] Resource ID. + * @member {string} [enabledState] Whether to enable use of this rule. + * Permitted values are 'Enabled' or 'Disabled'. Possible values include: + * 'Enabled', 'Disabled' + */ +export interface RoutingRuleUpdateParameters { + frontendEndpoints?: SubResource[]; + acceptedProtocols?: string[]; + patternsToMatch?: string[]; + customForwardingPath?: string; + forwardingProtocol?: string; + cacheConfiguration?: CacheConfiguration; + backendPool?: SubResource; + enabledState?: string; +} + +/** + * @class + * Initializes a new instance of the Backend class. + * @constructor + * Backend address of a frontDoor load balancer. + * + * @member {string} [address] Location of the backend (IP address or FQDN) + * @member {number} [httpPort] The HTTP TCP port number. Must be between 1 and + * 65535. + * @member {number} [httpsPort] The HTTPS TCP port number. Must be between 1 + * and 65535. + * @member {string} [enabledState] Whether to enable use of this backend. + * Permitted values are 'Enabled' or 'Disabled'. Possible values include: + * 'Enabled', 'Disabled' + * @member {number} [priority] Priority to use for load balancing. Higher + * priorities will not be used for load balancing if any lower priority backend + * is healthy. + * @member {number} [weight] Weight of this endpoint for load balancing + * purposes. + * @member {string} [backendHostHeader] The value to use as the host header + * sent to the backend. If blank or unspecified, this defaults to the incoming + * host. + */ +export interface Backend { + address?: string; + httpPort?: number; + httpsPort?: number; + enabledState?: string; + priority?: number; + weight?: number; + backendHostHeader?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancingSettingsUpdateParameters class. + * @constructor + * Round-Robin load balancing settings for a backend pool + * + * @member {number} [sampleSize] The number of samples to consider for load + * balancing decisions + * @member {number} [successfulSamplesRequired] The number of samples within + * the sample period that must succeed + * @member {number} [additionalLatencyMilliseconds] The additional latency in + * milliseconds for probes to fall into the lowest latency bucket + */ +export interface LoadBalancingSettingsUpdateParameters { + sampleSize?: number; + successfulSamplesRequired?: number; + additionalLatencyMilliseconds?: number; +} + +/** + * @class + * Initializes a new instance of the HealthProbeSettingsUpdateParameters class. + * @constructor + * L7 health probe settings for a backend pool + * + * @member {string} [path] The path to use for the health probe. Default is / + * @member {string} [protocol] Protocol scheme to use for this probe. Possible + * values include: 'Http', 'Https' + * @member {number} [intervalInSeconds] The number of seconds between health + * probes. + */ +export interface HealthProbeSettingsUpdateParameters { + path?: string; + protocol?: string; + intervalInSeconds?: number; +} + +/** + * @class + * Initializes a new instance of the BackendPoolUpdateParameters class. + * @constructor + * A collection of backends that can be routed to. + * + * @member {array} [backends] The set of backends for this pool + * @member {object} [loadBalancingSettings] Load balancing settings for a + * backend pool + * @member {string} [loadBalancingSettings.id] Resource ID. + * @member {object} [healthProbeSettings] L7 health probe settings for a + * backend pool + * @member {string} [healthProbeSettings.id] Resource ID. + */ +export interface BackendPoolUpdateParameters { + backends?: Backend[]; + loadBalancingSettings?: SubResource; + healthProbeSettings?: SubResource; +} + +/** + * @class + * Initializes a new instance of the FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink class. + * @constructor + * Defines the Web Application Firewall policy for each host (if applicable) + * + * @member {string} [id] Resource ID. + */ +export interface FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink { + id?: string; +} + +/** + * @class + * Initializes a new instance of the FrontendEndpointUpdateParameters class. + * @constructor + * Frontend endpoint used in routing rule + * + * @member {string} [hostName] The host name of the frontendEndpoint. Must be a + * domain name. + * @member {string} [sessionAffinityEnabledState] Whether to allow session + * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' + * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be + * ignored. The TTL to use in seconds for session affinity, if applicable. + * @member {object} [webApplicationFirewallPolicyLink] Defines the Web + * Application Firewall policy for each host (if applicable) + * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID. + */ +export interface FrontendEndpointUpdateParameters { + hostName?: string; + sessionAffinityEnabledState?: string; + sessionAffinityTtlSeconds?: number; + webApplicationFirewallPolicyLink?: FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink; +} + +/** + * @class + * Initializes a new instance of the ValidateCustomDomainInput class. + * @constructor + * Input of the custom domain to be validated for DNS mapping. + * + * @member {string} hostName The host name of the custom domain. Must be a + * domain name. + */ +export interface ValidateCustomDomainInput { + hostName: string; +} + +/** + * @class + * Initializes a new instance of the ValidateCustomDomainOutput class. + * @constructor + * Output of custom domain validation. + * + * @member {boolean} [customDomainValidated] Indicates whether the custom + * domain is valid or not. + * @member {string} [reason] The reason why the custom domain is not valid. + * @member {string} [message] Error message describing why the custom domain is + * not valid. + */ +export interface ValidateCustomDomainOutput { + readonly customDomainValidated?: boolean; + readonly reason?: string; + readonly message?: string; +} + +/** + * @class + * Initializes a new instance of the ErrorResponse class. + * @constructor + * Error reponse indicates Front Door service is not able to process the + * incoming request. The reason is provided in the error message. + * + * @member {string} [code] Error code. + * @member {string} [message] Error message indicating why the operation + * failed. + */ +export interface ErrorResponse { + readonly code?: string; + readonly message?: string; +} + +/** + * @class + * Initializes a new instance of the CheckNameAvailabilityInput class. + * @constructor + * Input of CheckNameAvailability API. + * + * @member {string} name The resource name to validate. + * @member {string} type The type of the resource whose name is to be + * validated. Possible values include: 'Microsoft.Network/frontDoors', + * 'Microsoft.Network/frontDoors/frontendEndpoints' + */ +export interface CheckNameAvailabilityInput { + name: string; + type: string; +} + +/** + * @class + * Initializes a new instance of the CheckNameAvailabilityOutput class. + * @constructor + * Output of check name availability API. + * + * @member {string} [nameAvailability] Indicates whether the name is available. + * Possible values include: 'Available', 'Unavailable' + * @member {string} [reason] The reason why the name is not available. + * @member {string} [message] The detailed error message describing why the + * name is not available. + */ +export interface CheckNameAvailabilityOutput { + readonly nameAvailability?: string; + readonly reason?: string; + readonly message?: string; +} + +/** + * @class + * Initializes a new instance of the ErrorDetails class. + * @constructor + * @member {string} [code] + * @member {string} [target] + * @member {string} [message] + */ +export interface ErrorDetails { + code?: string; + target?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * @member {string} [code] + * @member {string} [message] + * @member {string} [target] + * @member {array} [details] + * @member {string} [innerError] + */ +export interface ErrorModel { + code?: string; + message?: string; + target?: string; + details?: ErrorDetails[]; + innerError?: string; +} + +/** + * @class + * Initializes a new instance of the AzureAsyncOperationResult class. + * @constructor + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + * + * @member {string} [status] Status of the Azure async operation. Possible + * values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values + * include: 'InProgress', 'Succeeded', 'Failed' + * @member {object} [error] + * @member {string} [error.code] + * @member {string} [error.message] + * @member {string} [error.target] + * @member {array} [error.details] + * @member {string} [error.innerError] + */ +export interface AzureAsyncOperationResult { + status?: string; + error?: ErrorModel; +} + +/** + * @class + * Initializes a new instance of the TagsObject class. + * @constructor + * Tags object for patch operations. + * + * @member {object} [tags] Resource tags. + */ +export interface TagsObject { + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the PolicySettings class. + * @constructor + * Defines contents of a web application firewall global configuration + * + * @member {string} [enabledState] describes if the policy is in enabled state + * or disabled state. Possible values include: 'Disabled', 'Enabled' + * @member {string} [mode] Describes if it is in detection mode or prevention + * mode at policy level. Possible values include: 'Prevention', 'Detection' + */ +export interface PolicySettings { + enabledState?: string; + mode?: string; +} + +/** + * @class + * Initializes a new instance of the MatchCondition1 class. + * @constructor + * Define match conditions + * + * @member {string} matchVariable Match Variable. Possible values include: + * 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', + * 'RequestHeader', 'RequestBody' + * @member {string} [selector] Name of selector in RequestHeader or RequestBody + * to be matched + * @member {string} operator Describes operator to be matched. Possible values + * include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', 'LessThan', + * 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', + * 'EndsWith' + * @member {boolean} [negateCondition] Describes if this is negate condition or + * not + * @member {array} matchValue Match value + */ +export interface MatchCondition1 { + matchVariable: string; + selector?: string; + operator: string; + negateCondition?: boolean; + matchValue: string[]; +} + +/** + * @class + * Initializes a new instance of the CustomRule class. + * @constructor + * Defines contents of a web application rule + * + * @member {string} [name] Gets name of the resource that is unique within a + * policy. This name can be used to access the resource. + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + * @member {number} priority Describes priority of the rule. Rules with a lower + * value will be evaluated before rules with a higher value + * @member {string} ruleType Describes type of rule. Possible values include: + * 'MatchRule', 'RateLimitRule' + * @member {number} [rateLimitDurationInMinutes] Defines rate limit duration. + * Default - 1 minute + * @member {number} [rateLimitThreshold] Defines rate limit thresold + * @member {array} matchConditions List of match conditions + * @member {string} action Type of Actions. Possible values include: 'Allow', + * 'Block', 'Log' + * @member {array} [transforms] List of transforms + */ +export interface CustomRule { + name?: string; + readonly etag?: string; + priority: number; + ruleType: string; + rateLimitDurationInMinutes?: number; + rateLimitThreshold?: number; + matchConditions: MatchCondition1[]; + action: string; + transforms?: string[]; +} + +/** + * @class + * Initializes a new instance of the CustomRules class. + * @constructor + * Defines contents of custom rules + * + * @member {array} [rules] List of rules + */ +export interface CustomRules { + rules?: CustomRule[]; +} + +/** + * @class + * Initializes a new instance of the ManagedRuleSet class. + * @constructor + * Base class for all types of ManagedRuleSet. + * + * @member {number} [priority] Describes priority of the rule + * @member {number} [version] defines version of the ruleset + * @member {string} ruleSetType Polymorphic Discriminator + */ +export interface ManagedRuleSet { + priority?: number; + version?: number; + ruleSetType: string; +} + +/** + * @class + * Initializes a new instance of the ManagedRuleSets class. + * @constructor + * Defines ManagedRuleSets - array of managedRuleSet + * + * @member {array} [ruleSets] List of rules + */ +export interface ManagedRuleSets { + ruleSets?: ManagedRuleSet[]; +} + +/** + * @class + * Initializes a new instance of the WebApplicationFirewallPolicy1 class. + * @constructor + * Defines web application firewall policy. + * + * @member {object} [policySettings] Describes policySettings for policy + * @member {string} [policySettings.enabledState] describes if the policy is in + * enabled state or disabled state. Possible values include: 'Disabled', + * 'Enabled' + * @member {string} [policySettings.mode] Describes if it is in detection mode + * or prevention mode at policy level. Possible values include: 'Prevention', + * 'Detection' + * @member {object} [customRules] Describes custom rules inside the policy + * @member {array} [customRules.rules] List of rules + * @member {object} [managedRules] Describes managed rules inside the policy + * @member {array} [managedRules.ruleSets] List of rules + * @member {string} [provisioningState] Provisioning state of the + * WebApplicationFirewallPolicy. + * @member {string} [resourceState] Resource status of the policy. Possible + * values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + * 'Deleting' + * @member {string} [etag] Gets a unique read-only string that changes whenever + * the resource is updated. + */ +export interface WebApplicationFirewallPolicy1 extends Resource { + policySettings?: PolicySettings; + customRules?: CustomRules; + managedRules?: ManagedRuleSets; + readonly provisioningState?: string; + readonly resourceState?: string; + etag?: string; +} + +/** + * @class + * Initializes a new instance of the AzureManagedOverrideRuleGroup class. + * @constructor + * Defines contents of a web application rule + * + * @member {string} ruleGroupOverride Describes overrideruleGroup. Possible + * values include: 'SqlInjection', 'XSS' + * @member {string} action Type of Actions. Possible values include: 'Allow', + * 'Block', 'Log' + */ +export interface AzureManagedOverrideRuleGroup { + ruleGroupOverride: string; + action: string; +} + +/** + * @class + * Initializes a new instance of the AzureManagedRuleSet class. + * @constructor + * Describes azure managed provider. + * + * @member {array} [ruleGroupOverrides] List of azure managed provider override + * configuration (optional) + */ +export interface AzureManagedRuleSet extends ManagedRuleSet { + ruleGroupOverrides?: AzureManagedOverrideRuleGroup[]; +} + + +/** + * @class + * Initializes a new instance of the FrontDoorListResult class. + * @constructor + * Result of the request to list Front Doors. It contains a list of Front Door + * objects and a URL link to get the the next set of results. + * + * @member {string} [nextLink] URL to get the next set of Front Door objects if + * there are any. + */ +export interface FrontDoorListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RoutingRuleListResult class. + * @constructor + * Result of the request to list Routing Rules. It contains a list of Routing + * Rule objects and a URL link to get the the next set of results. + * + * @member {string} [nextLink] URL to get the next set of RoutingRule objects + * if there are any. + */ +export interface RoutingRuleListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the HealthProbeSettingsListResult class. + * @constructor + * Result of the request to list HealthProbeSettings. It contains a list of + * HealthProbeSettings objects and a URL link to get the the next set of + * results. + * + * @member {string} [nextLink] URL to get the next set of HealthProbeSettings + * objects if there are any. + */ +export interface HealthProbeSettingsListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the LoadBalancingSettingsListResult class. + * @constructor + * Result of the request to list load balancing settings. It contains a list of + * load balancing settings objects and a URL link to get the the next set of + * results. + * + * @member {string} [nextLink] URL to get the next set of LoadBalancingSettings + * objects if there are any. + */ +export interface LoadBalancingSettingsListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the BackendPoolListResult class. + * @constructor + * Result of the request to list Backend Pools. It contains a list of Backend + * Pools objects and a URL link to get the the next set of results. + * + * @member {string} [nextLink] URL to get the next set of BackendPool objects + * if there are any. + */ +export interface BackendPoolListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the FrontendEndpointsListResult class. + * @constructor + * Result of the request to list frontend endpoints. It contains a list of + * Frontend endpoint objects and a URL link to get the the next set of results. + * + * @member {string} [nextLink] URL to get the next set of frontend endpoints if + * there are any. + */ +export interface FrontendEndpointsListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the WebApplicationFirewallPolicyListResult class. + * @constructor + * Result of the request to list WebApplicationFirewallPolicies. It contains a + * list of WebApplicationFirewallPolicy objects and a URL link to get the the + * next set of results. + * + * @member {string} [nextLink] URL to get the next set of + * WebApplicationFirewallPolicy objects if there are any. + */ +export interface WebApplicationFirewallPolicyListResult extends Array { + nextLink?: string; +} diff --git a/lib/services/frontdoorManagement/lib/models/index.js b/lib/services/frontdoorManagement/lib/models/index.js new file mode 100644 index 0000000000..52d1260ba6 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/index.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. + */ + +/* 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.Resource = require('./resource'); +exports.FrontDoor = require('./frontDoor'); +exports.SubResource = require('./subResource'); +exports.RoutingRule = require('./routingRule'); +exports.LoadBalancingSettingsModel = require('./loadBalancingSettingsModel'); +exports.HealthProbeSettingsModel = require('./healthProbeSettingsModel'); +exports.BackendPool = require('./backendPool'); +exports.KeyVaultCertificateSourceParametersVault = require('./keyVaultCertificateSourceParametersVault'); +exports.CustomHttpsConfiguration = require('./customHttpsConfiguration'); +exports.FrontendEndpoint = require('./frontendEndpoint'); +exports.FrontDoorUpdateParameters = require('./frontDoorUpdateParameters'); +exports.PurgeParameters = require('./purgeParameters'); +exports.CacheConfiguration = require('./cacheConfiguration'); +exports.RoutingRuleUpdateParameters = require('./routingRuleUpdateParameters'); +exports.Backend = require('./backend'); +exports.LoadBalancingSettingsUpdateParameters = require('./loadBalancingSettingsUpdateParameters'); +exports.HealthProbeSettingsUpdateParameters = require('./healthProbeSettingsUpdateParameters'); +exports.BackendPoolUpdateParameters = require('./backendPoolUpdateParameters'); +exports.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink = require('./frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink'); +exports.FrontendEndpointUpdateParameters = require('./frontendEndpointUpdateParameters'); +exports.ValidateCustomDomainInput = require('./validateCustomDomainInput'); +exports.ValidateCustomDomainOutput = require('./validateCustomDomainOutput'); +exports.ErrorResponse = require('./errorResponse'); +exports.CheckNameAvailabilityInput = require('./checkNameAvailabilityInput'); +exports.CheckNameAvailabilityOutput = require('./checkNameAvailabilityOutput'); +exports.ErrorDetails = require('./errorDetails'); +exports.ErrorModel = require('./errorModel'); +exports.AzureAsyncOperationResult = require('./azureAsyncOperationResult'); +exports.TagsObject = require('./tagsObject'); +exports.PolicySettings = require('./policySettings'); +exports.MatchCondition1 = require('./matchCondition1'); +exports.CustomRule = require('./customRule'); +exports.CustomRules = require('./customRules'); +exports.ManagedRuleSet = require('./managedRuleSet'); +exports.ManagedRuleSets = require('./managedRuleSets'); +exports.WebApplicationFirewallPolicy1 = require('./webApplicationFirewallPolicy1'); +exports.AzureManagedOverrideRuleGroup = require('./azureManagedOverrideRuleGroup'); +exports.AzureManagedRuleSet = require('./azureManagedRuleSet'); +exports.FrontDoorListResult = require('./frontDoorListResult'); +exports.RoutingRuleListResult = require('./routingRuleListResult'); +exports.HealthProbeSettingsListResult = require('./healthProbeSettingsListResult'); +exports.LoadBalancingSettingsListResult = require('./loadBalancingSettingsListResult'); +exports.BackendPoolListResult = require('./backendPoolListResult'); +exports.FrontendEndpointsListResult = require('./frontendEndpointsListResult'); +exports.WebApplicationFirewallPolicyListResult = require('./webApplicationFirewallPolicyListResult'); +exports.discriminators = { + 'Unknown' : exports.ManagedRuleSet, + 'ManagedRuleSet.AzureManagedRuleSet' : exports.AzureManagedRuleSet +}; diff --git a/lib/services/frontdoorManagement/lib/models/keyVaultCertificateSourceParametersVault.js b/lib/services/frontdoorManagement/lib/models/keyVaultCertificateSourceParametersVault.js new file mode 100644 index 0000000000..b7cef60222 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/keyVaultCertificateSourceParametersVault.js @@ -0,0 +1,52 @@ +/* + * 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 Key Vault containing the SSL certificate + * + */ +class KeyVaultCertificateSourceParametersVault { + /** + * Create a KeyVaultCertificateSourceParametersVault. + * @member {string} [id] Resource ID. + */ + constructor() { + } + + /** + * Defines the metadata of KeyVaultCertificateSourceParametersVault + * + * @returns {object} metadata of KeyVaultCertificateSourceParametersVault + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVaultCertificateSourceParameters_vault', + type: { + name: 'Composite', + className: 'KeyVaultCertificateSourceParametersVault', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = KeyVaultCertificateSourceParametersVault; diff --git a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsListResult.js b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsListResult.js new file mode 100644 index 0000000000..e184b7ccde --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsListResult.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Result of the request to list load balancing settings. It contains a list of + * load balancing settings objects and a URL link to get the the next set of + * results. + */ +class LoadBalancingSettingsListResult extends Array { + /** + * Create a LoadBalancingSettingsListResult. + * @member {string} [nextLink] URL to get the next set of + * LoadBalancingSettings objects if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancingSettingsListResult + * + * @returns {object} metadata of LoadBalancingSettingsListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancingSettingsListResult', + type: { + name: 'Composite', + className: 'LoadBalancingSettingsListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LoadBalancingSettingsModelElementType', + type: { + name: 'Composite', + className: 'LoadBalancingSettingsModel' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancingSettingsListResult; diff --git a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsModel.js b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsModel.js new file mode 100644 index 0000000000..e1388e021e --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsModel.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'; + +const models = require('./index'); + +/** + * Load balancing settings for a backend pool + * + * @extends models['SubResource'] + */ +class LoadBalancingSettingsModel extends models['SubResource'] { + /** + * Create a LoadBalancingSettingsModel. + * @member {number} [sampleSize] The number of samples to consider for load + * balancing decisions + * @member {number} [successfulSamplesRequired] The number of samples within + * the sample period that must succeed + * @member {number} [additionalLatencyMilliseconds] The additional latency in + * milliseconds for probes to fall into the lowest latency bucket + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LoadBalancingSettingsModel + * + * @returns {object} metadata of LoadBalancingSettingsModel + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancingSettingsModel', + type: { + name: 'Composite', + className: 'LoadBalancingSettingsModel', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + sampleSize: { + required: false, + serializedName: 'properties.sampleSize', + type: { + name: 'Number' + } + }, + successfulSamplesRequired: { + required: false, + serializedName: 'properties.successfulSamplesRequired', + type: { + name: 'Number' + } + }, + additionalLatencyMilliseconds: { + required: false, + serializedName: 'properties.additionalLatencyMilliseconds', + type: { + name: 'Number' + } + }, + resourceState: { + required: false, + serializedName: 'properties.resourceState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LoadBalancingSettingsModel; diff --git a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsUpdateParameters.js new file mode 100644 index 0000000000..1abb521224 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsUpdateParameters.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Round-Robin load balancing settings for a backend pool + * + */ +class LoadBalancingSettingsUpdateParameters { + /** + * Create a LoadBalancingSettingsUpdateParameters. + * @member {number} [sampleSize] The number of samples to consider for load + * balancing decisions + * @member {number} [successfulSamplesRequired] The number of samples within + * the sample period that must succeed + * @member {number} [additionalLatencyMilliseconds] The additional latency in + * milliseconds for probes to fall into the lowest latency bucket + */ + constructor() { + } + + /** + * Defines the metadata of LoadBalancingSettingsUpdateParameters + * + * @returns {object} metadata of LoadBalancingSettingsUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'LoadBalancingSettingsUpdateParameters', + type: { + name: 'Composite', + className: 'LoadBalancingSettingsUpdateParameters', + modelProperties: { + sampleSize: { + required: false, + serializedName: 'sampleSize', + type: { + name: 'Number' + } + }, + successfulSamplesRequired: { + required: false, + serializedName: 'successfulSamplesRequired', + type: { + name: 'Number' + } + }, + additionalLatencyMilliseconds: { + required: false, + serializedName: 'additionalLatencyMilliseconds', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = LoadBalancingSettingsUpdateParameters; diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleSet.js b/lib/services/frontdoorManagement/lib/models/managedRuleSet.js new file mode 100644 index 0000000000..e115d2a68c --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleSet.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'; + +/** + * Base class for all types of ManagedRuleSet. + * + */ +class ManagedRuleSet { + /** + * Create a ManagedRuleSet. + * @member {number} [priority] Describes priority of the rule + * @member {number} [version] defines version of the ruleset + * @member {string} ruleSetType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ManagedRuleSet + * + * @returns {object} metadata of ManagedRuleSet + * + */ + mapper() { + return { + required: false, + serializedName: 'Unknown', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ruleSetType', + clientName: 'ruleSetType' + }, + uberParent: 'ManagedRuleSet', + className: 'ManagedRuleSet', + modelProperties: { + priority: { + required: false, + serializedName: 'priority', + type: { + name: 'Number' + } + }, + version: { + required: false, + serializedName: 'version', + type: { + name: 'Number' + } + }, + ruleSetType: { + required: true, + serializedName: 'ruleSetType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedRuleSet; diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleSets.js b/lib/services/frontdoorManagement/lib/models/managedRuleSets.js new file mode 100644 index 0000000000..ffc9449879 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleSets.js @@ -0,0 +1,65 @@ +/* + * 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'; + +/** + * Defines ManagedRuleSets - array of managedRuleSet + * + */ +class ManagedRuleSets { + /** + * Create a ManagedRuleSets. + * @member {array} [ruleSets] List of rules + */ + constructor() { + } + + /** + * Defines the metadata of ManagedRuleSets + * + * @returns {object} metadata of ManagedRuleSets + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedRuleSets', + type: { + name: 'Composite', + className: 'ManagedRuleSets', + modelProperties: { + ruleSets: { + required: false, + serializedName: 'ruleSets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedRuleSetElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ruleSetType', + clientName: 'ruleSetType' + }, + uberParent: 'ManagedRuleSet', + className: 'ManagedRuleSet' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedRuleSets; diff --git a/lib/services/frontdoorManagement/lib/models/matchCondition1.js b/lib/services/frontdoorManagement/lib/models/matchCondition1.js new file mode 100644 index 0000000000..e480792f23 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/matchCondition1.js @@ -0,0 +1,98 @@ +/* + * 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'; + +/** + * Define match conditions + * + */ +class MatchCondition1 { + /** + * Create a MatchCondition1. + * @member {string} matchVariable Match Variable. Possible values include: + * 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', + * 'RequestHeader', 'RequestBody' + * @member {string} [selector] Name of selector in RequestHeader or + * RequestBody to be matched + * @member {string} operator Describes operator to be matched. Possible + * values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', + * 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', + * 'BeginsWith', 'EndsWith' + * @member {boolean} [negateCondition] Describes if this is negate condition + * or not + * @member {array} matchValue Match value + */ + constructor() { + } + + /** + * Defines the metadata of MatchCondition1 + * + * @returns {object} metadata of MatchCondition1 + * + */ + mapper() { + return { + required: false, + serializedName: 'MatchCondition', + type: { + name: 'Composite', + className: 'MatchCondition1', + modelProperties: { + matchVariable: { + required: true, + serializedName: 'matchVariable', + type: { + name: 'String' + } + }, + selector: { + required: false, + serializedName: 'selector', + type: { + name: 'String' + } + }, + operator: { + required: true, + serializedName: 'operator', + type: { + name: 'String' + } + }, + negateCondition: { + required: false, + serializedName: 'negateCondition', + type: { + name: 'Boolean' + } + }, + matchValue: { + required: true, + serializedName: 'matchValue', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = MatchCondition1; diff --git a/lib/services/frontdoorManagement/lib/models/policySettings.js b/lib/services/frontdoorManagement/lib/models/policySettings.js new file mode 100644 index 0000000000..f75fd99adb --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/policySettings.js @@ -0,0 +1,63 @@ +/* + * 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'; + +/** + * Defines contents of a web application firewall global configuration + * + */ +class PolicySettings { + /** + * Create a PolicySettings. + * @member {string} [enabledState] describes if the policy is in enabled + * state or disabled state. Possible values include: 'Disabled', 'Enabled' + * @member {string} [mode] Describes if it is in detection mode or + * prevention mode at policy level. Possible values include: 'Prevention', + * 'Detection' + */ + constructor() { + } + + /** + * Defines the metadata of PolicySettings + * + * @returns {object} metadata of PolicySettings + * + */ + mapper() { + return { + required: false, + serializedName: 'policySettings', + type: { + name: 'Composite', + className: 'PolicySettings', + modelProperties: { + enabledState: { + required: false, + serializedName: 'enabledState', + type: { + name: 'String' + } + }, + mode: { + required: false, + serializedName: 'mode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PolicySettings; diff --git a/lib/services/frontdoorManagement/lib/models/purgeParameters.js b/lib/services/frontdoorManagement/lib/models/purgeParameters.js new file mode 100644 index 0000000000..e3be748479 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/purgeParameters.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Parameters required for content purge. + * + */ +class PurgeParameters { + /** + * Create a PurgeParameters. + * @member {array} contentPaths The path to the content to be purged. Can + * describe a file path or a wild card directory. + */ + constructor() { + } + + /** + * Defines the metadata of PurgeParameters + * + * @returns {object} metadata of PurgeParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'PurgeParameters', + type: { + name: 'Composite', + className: 'PurgeParameters', + modelProperties: { + contentPaths: { + required: true, + serializedName: 'contentPaths', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = PurgeParameters; diff --git a/lib/services/frontdoorManagement/lib/models/resource.js b/lib/services/frontdoorManagement/lib/models/resource.js new file mode 100644 index 0000000000..4b70929508 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/resource.js @@ -0,0 +1,98 @@ +/* + * 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'); + +/** + * Common resource representation. + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [location] Resource location. + * @member {object} [tags] Resource tags. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/frontdoorManagement/lib/models/routingRule.js b/lib/services/frontdoorManagement/lib/models/routingRule.js new file mode 100644 index 0000000000..4bbb21cafb --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/routingRule.js @@ -0,0 +1,186 @@ +/* + * 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 routing rule represents a specification for traffic to treat and where to + * send it, along with health probe information. + * + * @extends models['SubResource'] + */ +class RoutingRule extends models['SubResource'] { + /** + * Create a RoutingRule. + * @member {array} [frontendEndpoints] Frontend endpoints associated with + * this rule + * @member {array} [acceptedProtocols] Protocol schemes to match for this + * rule + * @member {array} [patternsToMatch] The route patterns of the rule. + * @member {string} [customForwardingPath] A custom path used to rewrite + * resource paths matched by this rule. Leave empty to use incoming path. + * @member {string} [forwardingProtocol] Protocol this rule will use when + * forwarding traffic to backends. Possible values include: 'HttpOnly', + * 'HttpsOnly', 'MatchRequest' + * @member {object} [cacheConfiguration] The caching configuration associated + * with this rule. + * @member {string} [cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * @member {string} [cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: + * 'Enabled', 'Disabled' + * @member {object} [backendPool] A reference to the BackendPool which this + * rule routes to. + * @member {string} [backendPool.id] Resource ID. + * @member {string} [enabledState] Whether to enable use of this rule. + * Permitted values are 'Enabled' or 'Disabled'. Possible values include: + * 'Enabled', 'Disabled' + * @member {string} [resourceState] Resource status. Possible values include: + * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RoutingRule + * + * @returns {object} metadata of RoutingRule + * + */ + mapper() { + return { + required: false, + serializedName: 'RoutingRule', + type: { + name: 'Composite', + className: 'RoutingRule', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + frontendEndpoints: { + required: false, + serializedName: 'properties.frontendEndpoints', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + acceptedProtocols: { + required: false, + serializedName: 'properties.acceptedProtocols', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontDoorProtocolElementType', + type: { + name: 'String' + } + } + } + }, + patternsToMatch: { + required: false, + serializedName: 'properties.patternsToMatch', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + customForwardingPath: { + required: false, + serializedName: 'properties.customForwardingPath', + type: { + name: 'String' + } + }, + forwardingProtocol: { + required: false, + serializedName: 'properties.forwardingProtocol', + type: { + name: 'String' + } + }, + cacheConfiguration: { + required: false, + serializedName: 'properties.cacheConfiguration', + type: { + name: 'Composite', + className: 'CacheConfiguration' + } + }, + backendPool: { + required: false, + serializedName: 'properties.backendPool', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + enabledState: { + required: false, + serializedName: 'properties.enabledState', + type: { + name: 'String' + } + }, + resourceState: { + required: false, + serializedName: 'properties.resourceState', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RoutingRule; diff --git a/lib/services/frontdoorManagement/lib/models/routingRuleListResult.js b/lib/services/frontdoorManagement/lib/models/routingRuleListResult.js new file mode 100644 index 0000000000..004f60a9f5 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/routingRuleListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Result of the request to list Routing Rules. It contains a list of Routing + * Rule objects and a URL link to get the the next set of results. + */ +class RoutingRuleListResult extends Array { + /** + * Create a RoutingRuleListResult. + * @member {string} [nextLink] URL to get the next set of RoutingRule objects + * if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RoutingRuleListResult + * + * @returns {object} metadata of RoutingRuleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RoutingRuleListResult', + type: { + name: 'Composite', + className: 'RoutingRuleListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RoutingRuleElementType', + type: { + name: 'Composite', + className: 'RoutingRule' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RoutingRuleListResult; diff --git a/lib/services/frontdoorManagement/lib/models/routingRuleUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/routingRuleUpdateParameters.js new file mode 100644 index 0000000000..7f02de2afd --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/routingRuleUpdateParameters.js @@ -0,0 +1,148 @@ +/* + * 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'; + +/** + * Routing rules to apply to an endpoint + * + */ +class RoutingRuleUpdateParameters { + /** + * Create a RoutingRuleUpdateParameters. + * @member {array} [frontendEndpoints] Frontend endpoints associated with + * this rule + * @member {array} [acceptedProtocols] Protocol schemes to match for this + * rule + * @member {array} [patternsToMatch] The route patterns of the rule. + * @member {string} [customForwardingPath] A custom path used to rewrite + * resource paths matched by this rule. Leave empty to use incoming path. + * @member {string} [forwardingProtocol] Protocol this rule will use when + * forwarding traffic to backends. Possible values include: 'HttpOnly', + * 'HttpsOnly', 'MatchRequest' + * @member {object} [cacheConfiguration] The caching configuration associated + * with this rule. + * @member {string} [cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * @member {string} [cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: + * 'Enabled', 'Disabled' + * @member {object} [backendPool] A reference to the BackendPool which this + * rule routes to. + * @member {string} [backendPool.id] Resource ID. + * @member {string} [enabledState] Whether to enable use of this rule. + * Permitted values are 'Enabled' or 'Disabled'. Possible values include: + * 'Enabled', 'Disabled' + */ + constructor() { + } + + /** + * Defines the metadata of RoutingRuleUpdateParameters + * + * @returns {object} metadata of RoutingRuleUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'RoutingRuleUpdateParameters', + type: { + name: 'Composite', + className: 'RoutingRuleUpdateParameters', + modelProperties: { + frontendEndpoints: { + required: false, + serializedName: 'frontendEndpoints', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + acceptedProtocols: { + required: false, + serializedName: 'acceptedProtocols', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontDoorProtocolElementType', + type: { + name: 'String' + } + } + } + }, + patternsToMatch: { + required: false, + serializedName: 'patternsToMatch', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + customForwardingPath: { + required: false, + serializedName: 'customForwardingPath', + type: { + name: 'String' + } + }, + forwardingProtocol: { + required: false, + serializedName: 'forwardingProtocol', + type: { + name: 'String' + } + }, + cacheConfiguration: { + required: false, + serializedName: 'cacheConfiguration', + type: { + name: 'Composite', + className: 'CacheConfiguration' + } + }, + backendPool: { + required: false, + serializedName: 'backendPool', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + enabledState: { + required: false, + serializedName: 'enabledState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RoutingRuleUpdateParameters; diff --git a/lib/services/frontdoorManagement/lib/models/subResource.js b/lib/services/frontdoorManagement/lib/models/subResource.js new file mode 100644 index 0000000000..51215f1707 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/subResource.js @@ -0,0 +1,56 @@ +/* + * 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'); + +/** + * Reference to another subresource. + * + * @extends models['BaseResource'] + */ +class SubResource extends models['BaseResource'] { + /** + * Create a SubResource. + * @member {string} [id] Resource ID. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubResource + * + * @returns {object} metadata of SubResource + * + */ + mapper() { + return { + required: false, + serializedName: 'SubResource', + type: { + name: 'Composite', + className: 'SubResource', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubResource; diff --git a/lib/services/frontdoorManagement/lib/models/tagsObject.js b/lib/services/frontdoorManagement/lib/models/tagsObject.js new file mode 100644 index 0000000000..755b116391 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/tagsObject.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * Tags object for patch operations. + * + */ +class TagsObject { + /** + * Create a TagsObject. + * @member {object} [tags] Resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of TagsObject + * + * @returns {object} metadata of TagsObject + * + */ + mapper() { + return { + required: false, + serializedName: 'TagsObject', + type: { + name: 'Composite', + className: 'TagsObject', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = TagsObject; diff --git a/lib/services/frontdoorManagement/lib/models/validateCustomDomainInput.js b/lib/services/frontdoorManagement/lib/models/validateCustomDomainInput.js new file mode 100644 index 0000000000..71bf5ec871 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/validateCustomDomainInput.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input of the custom domain to be validated for DNS mapping. + * + */ +class ValidateCustomDomainInput { + /** + * Create a ValidateCustomDomainInput. + * @member {string} hostName The host name of the custom domain. Must be a + * domain name. + */ + constructor() { + } + + /** + * Defines the metadata of ValidateCustomDomainInput + * + * @returns {object} metadata of ValidateCustomDomainInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateCustomDomainInput', + type: { + name: 'Composite', + className: 'ValidateCustomDomainInput', + modelProperties: { + hostName: { + required: true, + serializedName: 'hostName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ValidateCustomDomainInput; diff --git a/lib/services/frontdoorManagement/lib/models/validateCustomDomainOutput.js b/lib/services/frontdoorManagement/lib/models/validateCustomDomainOutput.js new file mode 100644 index 0000000000..cf285a32b7 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/validateCustomDomainOutput.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * Output of custom domain validation. + * + */ +class ValidateCustomDomainOutput { + /** + * Create a ValidateCustomDomainOutput. + * @member {boolean} [customDomainValidated] Indicates whether the custom + * domain is valid or not. + * @member {string} [reason] The reason why the custom domain is not valid. + * @member {string} [message] Error message describing why the custom domain + * is not valid. + */ + constructor() { + } + + /** + * Defines the metadata of ValidateCustomDomainOutput + * + * @returns {object} metadata of ValidateCustomDomainOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateCustomDomainOutput', + type: { + name: 'Composite', + className: 'ValidateCustomDomainOutput', + modelProperties: { + customDomainValidated: { + required: false, + readOnly: true, + serializedName: 'customDomainValidated', + type: { + name: 'Boolean' + } + }, + reason: { + required: false, + readOnly: true, + serializedName: 'reason', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ValidateCustomDomainOutput; diff --git a/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicy1.js b/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicy1.js new file mode 100644 index 0000000000..f9385e9118 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicy1.js @@ -0,0 +1,158 @@ +/* + * 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'); + +/** + * Defines web application firewall policy. + * + * @extends models['Resource'] + */ +class WebApplicationFirewallPolicy1 extends models['Resource'] { + /** + * Create a WebApplicationFirewallPolicy1. + * @member {object} [policySettings] Describes policySettings for policy + * @member {string} [policySettings.enabledState] describes if the policy is + * in enabled state or disabled state. Possible values include: 'Disabled', + * 'Enabled' + * @member {string} [policySettings.mode] Describes if it is in detection + * mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * @member {object} [customRules] Describes custom rules inside the policy + * @member {array} [customRules.rules] List of rules + * @member {object} [managedRules] Describes managed rules inside the policy + * @member {array} [managedRules.ruleSets] List of rules + * @member {string} [provisioningState] Provisioning state of the + * WebApplicationFirewallPolicy. + * @member {string} [resourceState] Resource status of the policy. Possible + * values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * @member {string} [etag] Gets a unique read-only string that changes + * whenever the resource is updated. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WebApplicationFirewallPolicy1 + * + * @returns {object} metadata of WebApplicationFirewallPolicy1 + * + */ + mapper() { + return { + required: false, + serializedName: 'WebApplicationFirewallPolicy', + type: { + name: 'Composite', + className: 'WebApplicationFirewallPolicy1', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + policySettings: { + required: false, + serializedName: 'properties.policySettings', + type: { + name: 'Composite', + className: 'PolicySettings' + } + }, + customRules: { + required: false, + serializedName: 'properties.customRules', + type: { + name: 'Composite', + className: 'CustomRules' + } + }, + managedRules: { + required: false, + serializedName: 'properties.managedRules', + type: { + name: 'Composite', + className: 'ManagedRuleSets' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + resourceState: { + required: false, + readOnly: true, + serializedName: 'properties.resourceState', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WebApplicationFirewallPolicy1; diff --git a/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicyListResult.js b/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicyListResult.js new file mode 100644 index 0000000000..501e486108 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicyListResult.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Result of the request to list WebApplicationFirewallPolicies. It contains a + * list of WebApplicationFirewallPolicy objects and a URL link to get the the + * next set of results. + */ +class WebApplicationFirewallPolicyListResult extends Array { + /** + * Create a WebApplicationFirewallPolicyListResult. + * @member {string} [nextLink] URL to get the next set of + * WebApplicationFirewallPolicy objects if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WebApplicationFirewallPolicyListResult + * + * @returns {object} metadata of WebApplicationFirewallPolicyListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'WebApplicationFirewallPolicyListResult', + type: { + name: 'Composite', + className: 'WebApplicationFirewallPolicyListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WebApplicationFirewallPolicy1ElementType', + type: { + name: 'Composite', + className: 'WebApplicationFirewallPolicy1' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WebApplicationFirewallPolicyListResult; diff --git a/lib/services/frontdoorManagement/lib/operations/backendPools.js b/lib/services/frontdoorManagement/lib/operations/backendPools.js new file mode 100644 index 0000000000..4db963cac1 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/backendPools.js @@ -0,0 +1,1900 @@ +/* + * 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; + +/** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoor(resourceGroupName, frontDoorName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackendPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a Backend Pool with the specified Pool name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPool} for more information. + * + * {object} [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, frontDoorName, backendPoolName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (backendPoolName === null || backendPoolName === undefined || typeof backendPoolName.valueOf() !== 'string') { + throw new Error('backendPoolName cannot be null or undefined and it must be of type string.'); + } + if (backendPoolName !== null && backendPoolName !== undefined) { + if (backendPoolName.length > 90) + { + throw new Error('"backendPoolName" should satisfy the constraint - "MaxLength": 90'); + } + if (backendPoolName.length < 1) + { + throw new Error('"backendPoolName" should satisfy the constraint - "MinLength": 1'); + } + if (backendPoolName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"backendPoolName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{backendPoolName}', encodeURIComponent(backendPoolName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackendPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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 BackendPool} for more information. + * + * {object} [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, frontDoorName, backendPoolName, backendPoolParameters, options, callback) { + /* jshint 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, frontDoorName, backendPoolName, backendPoolParameters, 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['BackendPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, backendPoolName, options, callback) { + /* jshint 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, frontDoorName, backendPoolName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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 BackendPool} for more information. + * + * {object} [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, frontDoorName, backendPoolName, backendPoolParameters, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (backendPoolName === null || backendPoolName === undefined || typeof backendPoolName.valueOf() !== 'string') { + throw new Error('backendPoolName cannot be null or undefined and it must be of type string.'); + } + if (backendPoolName !== null && backendPoolName !== undefined) { + if (backendPoolName.length > 90) + { + throw new Error('"backendPoolName" should satisfy the constraint - "MaxLength": 90'); + } + if (backendPoolName.length < 1) + { + throw new Error('"backendPoolName" should satisfy the constraint - "MinLength": 1'); + } + if (backendPoolName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"backendPoolName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (backendPoolParameters === null || backendPoolParameters === undefined) { + throw new Error('backendPoolParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{backendPoolName}', encodeURIComponent(backendPoolName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (backendPoolParameters !== null && backendPoolParameters !== undefined) { + let requestModelMapper = new client.models['BackendPool']().mapper(); + requestModel = client.serialize(requestModelMapper, backendPoolParameters, 'backendPoolParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(backendPoolParameters, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackendPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['BackendPool']().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['BackendPool']().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); + }); +} + +/** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, backendPoolName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (backendPoolName === null || backendPoolName === undefined || typeof backendPoolName.valueOf() !== 'string') { + throw new Error('backendPoolName cannot be null or undefined and it must be of type string.'); + } + if (backendPoolName !== null && backendPoolName !== undefined) { + if (backendPoolName.length > 90) + { + throw new Error('"backendPoolName" should satisfy the constraint - "MaxLength": 90'); + } + if (backendPoolName.length < 1) + { + throw new Error('"backendPoolName" should satisfy the constraint - "MinLength": 1'); + } + if (backendPoolName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"backendPoolName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{backendPoolName}', encodeURIComponent(backendPoolName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 BackendPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoorNext(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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackendPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 BackendPools. */ +class BackendPools { + /** + * Create a BackendPools. + * @param {FrontdoorManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByFrontDoor = _listByFrontDoor; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByFrontDoorNext = _listByFrontDoorNext; + } + + /** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName, frontDoorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BackendPoolListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback); + } + } + + /** + * Gets a Backend Pool with the specified Pool name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, backendPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, frontDoorName, backendPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a Backend Pool with the specified Pool name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BackendPool} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPool} for more information. + * + * {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, frontDoorName, backendPoolName, options, optionalCallback) { + 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, frontDoorName, backendPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, frontDoorName, backendPoolName, options, optionalCallback); + } + } + + /** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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 {BackendPool} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPool} for more information. + * + * {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, frontDoorName, backendPoolName, backendPoolParameters, options, optionalCallback) { + 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, frontDoorName, backendPoolName, backendPoolParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, backendPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, frontDoorName, backendPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, backendPoolName, options, optionalCallback) { + 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, frontDoorName, backendPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, frontDoorName, backendPoolName, options, optionalCallback); + } + } + + /** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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 {BackendPool} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPool} for more information. + * + * {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, frontDoorName, backendPoolName, backendPoolParameters, options, optionalCallback) { + 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, frontDoorName, backendPoolName, backendPoolParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, backendPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, frontDoorName, backendPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, backendPoolName, options, optionalCallback) { + 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, frontDoorName, backendPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, frontDoorName, backendPoolName, options, optionalCallback); + } + } + + /** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 {BackendPoolListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(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._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoorNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = BackendPools; diff --git a/lib/services/frontdoorManagement/lib/operations/endpoints.js b/lib/services/frontdoorManagement/lib/operations/endpoints.js new file mode 100644 index 0000000000..93b32a7b12 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/endpoints.js @@ -0,0 +1,495 @@ +/* + * 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; + + +/** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _purgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, callback) { + /* jshint 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.beginPurgeContent(resourceGroupName, frontDoorName, contentFilePaths, 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); + }); + }); +} + +/** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _beginPurgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (contentFilePaths === null || contentFilePaths === undefined) { + throw new Error('contentFilePaths cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/purge'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (contentFilePaths !== null && contentFilePaths !== undefined) { + let requestModelMapper = new client.models['PurgeParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, contentFilePaths, 'contentFilePaths'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(contentFilePaths, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Endpoints. */ +class Endpoints { + /** + * Create a Endpoints. + * @param {FrontdoorManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._purgeContent = _purgeContent; + this._beginPurgeContent = _beginPurgeContent; + } + + /** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + purgeContentWithHttpOperationResponse(resourceGroupName, frontDoorName, contentFilePaths, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._purgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + purgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._purgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._purgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, optionalCallback); + } + } + + /** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginPurgeContentWithHttpOperationResponse(resourceGroupName, frontDoorName, contentFilePaths, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginPurgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + beginPurgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginPurgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginPurgeContent(resourceGroupName, frontDoorName, contentFilePaths, options, optionalCallback); + } + } + +} + +module.exports = Endpoints; diff --git a/lib/services/frontdoorManagement/lib/operations/frontDoors.js b/lib/services/frontdoorManagement/lib/operations/frontDoors.js new file mode 100644 index 0000000000..a730df07fd --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/frontDoors.js @@ -0,0 +1,2566 @@ +/* + * 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; + +/** + * Lists all of the Front Doors within an Azure 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 FrontDoorListResult} for more information. + * + * {object} [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 apiVersion = '2018-08-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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.Network/frontDoors'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontDoorListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure 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 FrontDoorListResult} for more information. + * + * {object} [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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontDoorListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a Front Door with the specified Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoor} for more information. + * + * {object} [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, frontDoorName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontDoor']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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 FrontDoor} for more information. + * + * {object} [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, frontDoorName, frontDoorParameters, options, callback) { + /* jshint 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, frontDoorName, frontDoorParameters, 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['FrontDoor']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, options, callback) { + /* jshint 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, frontDoorName, 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); + }); + }); +} + +/** + * Validates the custom domain mapping to ensure it maps to the correct Front + * Door endpoint in DNS. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} customDomainProperties Custom domain to be validated. + * + * @param {string} customDomainProperties.hostName The host name of the custom + * domain. Must be a domain 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 ValidateCustomDomainOutput} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _validateCustomDomain(resourceGroupName, frontDoorName, customDomainProperties, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (customDomainProperties === null || customDomainProperties === undefined) { + throw new Error('customDomainProperties cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/validateCustomDomain'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (customDomainProperties !== null && customDomainProperties !== undefined) { + let requestModelMapper = new client.models['ValidateCustomDomainInput']().mapper(); + requestModel = client.serialize(requestModelMapper, customDomainProperties, 'customDomainProperties'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(customDomainProperties, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ValidateCustomDomainOutput']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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 FrontDoor} for more information. + * + * {object} [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, frontDoorName, frontDoorParameters, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (frontDoorParameters === null || frontDoorParameters === undefined) { + throw new Error('frontDoorParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (frontDoorParameters !== null && frontDoorParameters !== undefined) { + let requestModelMapper = new client.models['FrontDoor']().mapper(); + requestModel = client.serialize(requestModelMapper, frontDoorParameters, 'frontDoorParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(frontDoorParameters, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontDoor']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['FrontDoor']().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['FrontDoor']().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); + }); +} + +/** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Lists all of the Front Doors within an Azure 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 FrontDoorListResult} for more information. + * + * {object} [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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontDoorListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the Front Doors within a resource group under 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 FrontDoorListResult} for more information. + * + * {object} [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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontDoorListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 FrontDoors. */ +class FrontDoors { + /** + * Create a FrontDoors. + * @param {FrontdoorManagementClient} 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._validateCustomDomain = _validateCustomDomain; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Lists all of the Front Doors within an Azure 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; + }); + }); + } + + /** + * Lists all of the Front Doors within an Azure 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 {FrontDoorListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoorListResult} for more information. + * + * {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); + } + } + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure 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. + */ + 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; + }); + }); + } + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure 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 {FrontDoorListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoorListResult} for more information. + * + * {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); + } + } + + /** + * Gets a Front Door with the specified Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a Front Door with the specified Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FrontDoor} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoor} for more information. + * + * {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, frontDoorName, options, optionalCallback) { + 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, frontDoorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, frontDoorName, options, optionalCallback); + } + } + + /** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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, frontDoorName, frontDoorParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, frontDoorName, frontDoorParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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 {FrontDoor} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoor} for more information. + * + * {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, frontDoorName, frontDoorParameters, options, optionalCallback) { + 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, frontDoorName, frontDoorParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, frontDoorName, frontDoorParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, options, optionalCallback) { + 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, frontDoorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, frontDoorName, options, optionalCallback); + } + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front + * Door endpoint in DNS. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} customDomainProperties Custom domain to be validated. + * + * @param {string} customDomainProperties.hostName The host name of the custom + * domain. Must be a domain 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. + */ + validateCustomDomainWithHttpOperationResponse(resourceGroupName, frontDoorName, customDomainProperties, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._validateCustomDomain(resourceGroupName, frontDoorName, customDomainProperties, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front + * Door endpoint in DNS. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} customDomainProperties Custom domain to be validated. + * + * @param {string} customDomainProperties.hostName The host name of the custom + * domain. Must be a domain 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 {ValidateCustomDomainOutput} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ValidateCustomDomainOutput} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + validateCustomDomain(resourceGroupName, frontDoorName, customDomainProperties, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._validateCustomDomain(resourceGroupName, frontDoorName, customDomainProperties, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._validateCustomDomain(resourceGroupName, frontDoorName, customDomainProperties, options, optionalCallback); + } + } + + /** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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, frontDoorName, frontDoorParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, frontDoorName, frontDoorParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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 {FrontDoor} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoor} for more information. + * + * {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, frontDoorName, frontDoorParameters, options, optionalCallback) { + 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, frontDoorName, frontDoorParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, frontDoorName, frontDoorParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, options, optionalCallback) { + 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, frontDoorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, frontDoorName, options, optionalCallback); + } + } + + /** + * Lists all of the Front Doors within an Azure 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; + }); + }); + } + + /** + * Lists all of the Front Doors within an Azure 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 {FrontDoorListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoorListResult} for more information. + * + * {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); + } + } + + /** + * Lists all of the Front Doors within a resource group under 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. + */ + 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; + }); + }); + } + + /** + * Lists all of the Front Doors within a resource group under 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 {FrontDoorListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoorListResult} for more information. + * + * {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 = FrontDoors; diff --git a/lib/services/frontdoorManagement/lib/operations/frontendEndpoints.js b/lib/services/frontdoorManagement/lib/operations/frontendEndpoints.js new file mode 100644 index 0000000000..2db92c4aa0 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/frontendEndpoints.js @@ -0,0 +1,2999 @@ +/* + * 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; + +/** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpointsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoor(resourceGroupName, frontDoorName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontendEndpointsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a Frontend endpoint with the specified name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpoint} for more information. + * + * {object} [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, frontDoorName, frontendEndpointName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (frontendEndpointName === null || frontendEndpointName === undefined || typeof frontendEndpointName.valueOf() !== 'string') { + throw new Error('frontendEndpointName cannot be null or undefined and it must be of type string.'); + } + if (frontendEndpointName !== null && frontendEndpointName !== undefined) { + if (frontendEndpointName.length > 255) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MaxLength": 255'); + } + if (frontendEndpointName.length < 1) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MinLength": 1'); + } + if (frontendEndpointName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{frontendEndpointName}', encodeURIComponent(frontendEndpointName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontendEndpoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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 FrontendEndpoint} for more information. + * + * {object} [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, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, callback) { + /* jshint 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, frontDoorName, frontendEndpointName, frontendEndpointParameters, 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['FrontendEndpoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, frontendEndpointName, options, callback) { + /* jshint 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, frontDoorName, frontendEndpointName, 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); + }); + }); +} + + +/** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {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 _enableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, callback) { + /* jshint 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.beginEnableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, 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); + }); + }); +} + + +/** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _disableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, callback) { + /* jshint 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.beginDisableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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 FrontendEndpoint} for more information. + * + * {object} [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, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (frontendEndpointName === null || frontendEndpointName === undefined || typeof frontendEndpointName.valueOf() !== 'string') { + throw new Error('frontendEndpointName cannot be null or undefined and it must be of type string.'); + } + if (frontendEndpointName !== null && frontendEndpointName !== undefined) { + if (frontendEndpointName.length > 255) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MaxLength": 255'); + } + if (frontendEndpointName.length < 1) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MinLength": 1'); + } + if (frontendEndpointName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (frontendEndpointParameters === null || frontendEndpointParameters === undefined) { + throw new Error('frontendEndpointParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{frontendEndpointName}', encodeURIComponent(frontendEndpointName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (frontendEndpointParameters !== null && frontendEndpointParameters !== undefined) { + let requestModelMapper = new client.models['FrontendEndpoint']().mapper(); + requestModel = client.serialize(requestModelMapper, frontendEndpointParameters, 'frontendEndpointParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(frontendEndpointParameters, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontendEndpoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['FrontendEndpoint']().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['FrontendEndpoint']().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); + }); +} + +/** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, frontendEndpointName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (frontendEndpointName === null || frontendEndpointName === undefined || typeof frontendEndpointName.valueOf() !== 'string') { + throw new Error('frontendEndpointName cannot be null or undefined and it must be of type string.'); + } + if (frontendEndpointName !== null && frontendEndpointName !== undefined) { + if (frontendEndpointName.length > 255) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MaxLength": 255'); + } + if (frontendEndpointName.length < 1) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MinLength": 1'); + } + if (frontendEndpointName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{frontendEndpointName}', encodeURIComponent(frontendEndpointName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {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 _beginEnableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (frontendEndpointName === null || frontendEndpointName === undefined || typeof frontendEndpointName.valueOf() !== 'string') { + throw new Error('frontendEndpointName cannot be null or undefined and it must be of type string.'); + } + if (frontendEndpointName !== null && frontendEndpointName !== undefined) { + if (frontendEndpointName.length > 255) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MaxLength": 255'); + } + if (frontendEndpointName.length < 1) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MinLength": 1'); + } + if (frontendEndpointName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (customHttpsConfiguration === null || customHttpsConfiguration === undefined) { + throw new Error('customHttpsConfiguration cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/enableHttps'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{frontendEndpointName}', encodeURIComponent(frontendEndpointName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (customHttpsConfiguration !== null && customHttpsConfiguration !== undefined) { + let requestModelMapper = new client.models['CustomHttpsConfiguration']().mapper(); + requestModel = client.serialize(requestModelMapper, customHttpsConfiguration, 'customHttpsConfiguration'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(customHttpsConfiguration, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _beginDisableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (frontendEndpointName === null || frontendEndpointName === undefined || typeof frontendEndpointName.valueOf() !== 'string') { + throw new Error('frontendEndpointName cannot be null or undefined and it must be of type string.'); + } + if (frontendEndpointName !== null && frontendEndpointName !== undefined) { + if (frontendEndpointName.length > 255) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MaxLength": 255'); + } + if (frontendEndpointName.length < 1) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "MinLength": 1'); + } + if (frontendEndpointName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontendEndpointName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/disableHttps'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{frontendEndpointName}', encodeURIComponent(frontendEndpointName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 FrontendEndpointsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoorNext(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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FrontendEndpointsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 FrontendEndpoints. */ +class FrontendEndpoints { + /** + * Create a FrontendEndpoints. + * @param {FrontdoorManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByFrontDoor = _listByFrontDoor; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._enableHttps = _enableHttps; + this._disableHttps = _disableHttps; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginEnableHttps = _beginEnableHttps; + this._beginDisableHttps = _beginDisableHttps; + this._listByFrontDoorNext = _listByFrontDoorNext; + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName, frontDoorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FrontendEndpointsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpointsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback); + } + } + + /** + * Gets a Frontend endpoint with the specified name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, frontendEndpointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a Frontend endpoint with the specified name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FrontendEndpoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpoint} for more information. + * + * {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, frontDoorName, frontendEndpointName, options, optionalCallback) { + 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, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, frontDoorName, frontendEndpointName, options, optionalCallback); + } + } + + /** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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 {FrontendEndpoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpoint} for more information. + * + * {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, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, optionalCallback) { + 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, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, frontendEndpointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, frontendEndpointName, options, optionalCallback) { + 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, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, frontDoorName, frontendEndpointName, options, optionalCallback); + } + } + + /** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + enableHttpsWithHttpOperationResponse(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._enableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {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. + */ + enableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._enableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._enableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, optionalCallback); + } + } + + /** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + disableHttpsWithHttpOperationResponse(resourceGroupName, frontDoorName, frontendEndpointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._disableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + disableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._disableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._disableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, optionalCallback); + } + } + + /** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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 {FrontendEndpoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpoint} for more information. + * + * {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, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, optionalCallback) { + 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, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, frontendEndpointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, frontendEndpointName, options, optionalCallback) { + 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, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, frontDoorName, frontendEndpointName, options, optionalCallback); + } + } + + /** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginEnableHttpsWithHttpOperationResponse(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginEnableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {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. + */ + beginEnableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginEnableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginEnableHttps(resourceGroupName, frontDoorName, frontendEndpointName, customHttpsConfiguration, options, optionalCallback); + } + } + + /** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDisableHttpsWithHttpOperationResponse(resourceGroupName, frontDoorName, frontendEndpointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDisableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + beginDisableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDisableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDisableHttps(resourceGroupName, frontDoorName, frontendEndpointName, options, optionalCallback); + } + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 {FrontendEndpointsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpointsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(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._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoorNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = FrontendEndpoints; diff --git a/lib/services/frontdoorManagement/lib/operations/healthProbeSettings.js b/lib/services/frontdoorManagement/lib/operations/healthProbeSettings.js new file mode 100644 index 0000000000..4e8c2c528b --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/healthProbeSettings.js @@ -0,0 +1,1898 @@ +/* + * 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; + +/** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoor(resourceGroupName, frontDoorName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['HealthProbeSettingsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a HealthProbeSettings with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsModel} for more + * information. + * + * {object} [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, frontDoorName, healthProbeSettingsName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (healthProbeSettingsName === null || healthProbeSettingsName === undefined || typeof healthProbeSettingsName.valueOf() !== 'string') { + throw new Error('healthProbeSettingsName cannot be null or undefined and it must be of type string.'); + } + if (healthProbeSettingsName !== null && healthProbeSettingsName !== undefined) { + if (healthProbeSettingsName.length > 90) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "MaxLength": 90'); + } + if (healthProbeSettingsName.length < 1) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "MinLength": 1'); + } + if (healthProbeSettingsName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{healthProbeSettingsName}', encodeURIComponent(healthProbeSettingsName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['HealthProbeSettingsModel']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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 HealthProbeSettingsModel} for more + * information. + * + * {object} [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, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, callback) { + /* jshint 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, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, 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['HealthProbeSettingsModel']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, healthProbeSettingsName, options, callback) { + /* jshint 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, frontDoorName, healthProbeSettingsName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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 HealthProbeSettingsModel} for more + * information. + * + * {object} [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, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (healthProbeSettingsName === null || healthProbeSettingsName === undefined || typeof healthProbeSettingsName.valueOf() !== 'string') { + throw new Error('healthProbeSettingsName cannot be null or undefined and it must be of type string.'); + } + if (healthProbeSettingsName !== null && healthProbeSettingsName !== undefined) { + if (healthProbeSettingsName.length > 90) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "MaxLength": 90'); + } + if (healthProbeSettingsName.length < 1) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "MinLength": 1'); + } + if (healthProbeSettingsName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (healthProbeSettingsParameters === null || healthProbeSettingsParameters === undefined) { + throw new Error('healthProbeSettingsParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{healthProbeSettingsName}', encodeURIComponent(healthProbeSettingsName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (healthProbeSettingsParameters !== null && healthProbeSettingsParameters !== undefined) { + let requestModelMapper = new client.models['HealthProbeSettingsModel']().mapper(); + requestModel = client.serialize(requestModelMapper, healthProbeSettingsParameters, 'healthProbeSettingsParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(healthProbeSettingsParameters, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['HealthProbeSettingsModel']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['HealthProbeSettingsModel']().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['HealthProbeSettingsModel']().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); + }); +} + +/** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, healthProbeSettingsName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (healthProbeSettingsName === null || healthProbeSettingsName === undefined || typeof healthProbeSettingsName.valueOf() !== 'string') { + throw new Error('healthProbeSettingsName cannot be null or undefined and it must be of type string.'); + } + if (healthProbeSettingsName !== null && healthProbeSettingsName !== undefined) { + if (healthProbeSettingsName.length > 90) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "MaxLength": 90'); + } + if (healthProbeSettingsName.length < 1) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "MinLength": 1'); + } + if (healthProbeSettingsName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"healthProbeSettingsName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{healthProbeSettingsName}', encodeURIComponent(healthProbeSettingsName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 HealthProbeSettingsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoorNext(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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['HealthProbeSettingsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 HealthProbeSettings. */ +class HealthProbeSettings { + /** + * Create a HealthProbeSettings. + * @param {FrontdoorManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByFrontDoor = _listByFrontDoor; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByFrontDoorNext = _listByFrontDoorNext; + } + + /** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName, frontDoorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HealthProbeSettingsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback); + } + } + + /** + * Gets a HealthProbeSettings with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, healthProbeSettingsName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, frontDoorName, healthProbeSettingsName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a HealthProbeSettings with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HealthProbeSettingsModel} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsModel} for more + * information. + * + * {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, frontDoorName, healthProbeSettingsName, options, optionalCallback) { + 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, frontDoorName, healthProbeSettingsName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, frontDoorName, healthProbeSettingsName, options, optionalCallback); + } + } + + /** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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 {HealthProbeSettingsModel} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsModel} for more + * information. + * + * {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, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, optionalCallback) { + 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, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, healthProbeSettingsName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, frontDoorName, healthProbeSettingsName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, healthProbeSettingsName, options, optionalCallback) { + 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, frontDoorName, healthProbeSettingsName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, frontDoorName, healthProbeSettingsName, options, optionalCallback); + } + } + + /** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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 {HealthProbeSettingsModel} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsModel} for more + * information. + * + * {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, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, optionalCallback) { + 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, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, healthProbeSettingsName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, frontDoorName, healthProbeSettingsName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, healthProbeSettingsName, options, optionalCallback) { + 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, frontDoorName, healthProbeSettingsName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, frontDoorName, healthProbeSettingsName, options, optionalCallback); + } + } + + /** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 {HealthProbeSettingsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(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._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoorNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = HealthProbeSettings; diff --git a/lib/services/frontdoorManagement/lib/operations/index.d.ts b/lib/services/frontdoorManagement/lib/operations/index.d.ts new file mode 100644 index 0000000000..cdf61978fb --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/index.d.ts @@ -0,0 +1,4711 @@ +/* + * 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 models from '../models'; + + +/** + * @class + * FrontDoors + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontdoorManagementClient. + */ +export interface FrontDoors { + + + /** + * Lists all of the Front Doors within an Azure 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>; + + /** + * Lists all of the Front Doors within an Azure 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 {FrontDoorListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontDoorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoorListResult} for more information. + * + * {WebResource} [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; + + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure 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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the Front Doors within a resource group under a subscription. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure 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 {FrontDoorListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontDoorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoorListResult} for more information. + * + * {WebResource} [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; + + + /** + * Gets a Front Door with the specified Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a Front Door with the specified Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FrontDoor} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontDoor} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoor} for more information. + * + * {WebResource} [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, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, frontDoorName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, frontDoorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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, frontDoorName: string, frontDoorParameters: models.FrontDoor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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 {FrontDoor} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontDoor} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoor} for more information. + * + * {WebResource} [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, frontDoorName: string, frontDoorParameters: models.FrontDoor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, frontDoorName: string, frontDoorParameters: models.FrontDoor, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, frontDoorName: string, frontDoorParameters: models.FrontDoor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, frontDoorName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, frontDoorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front + * Door endpoint in DNS. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} customDomainProperties Custom domain to be validated. + * + * @param {string} customDomainProperties.hostName The host name of the custom + * domain. Must be a domain 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. + */ + validateCustomDomainWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, customDomainProperties: models.ValidateCustomDomainInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Validates the custom domain mapping to ensure it maps to the correct Front + * Door endpoint in DNS. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} customDomainProperties Custom domain to be validated. + * + * @param {string} customDomainProperties.hostName The host name of the custom + * domain. Must be a domain 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 {ValidateCustomDomainOutput} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ValidateCustomDomainOutput} [result] - The deserialized result object if an error did not occur. + * See {@link ValidateCustomDomainOutput} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + validateCustomDomain(resourceGroupName: string, frontDoorName: string, customDomainProperties: models.ValidateCustomDomainInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validateCustomDomain(resourceGroupName: string, frontDoorName: string, customDomainProperties: models.ValidateCustomDomainInput, callback: ServiceCallback): void; + validateCustomDomain(resourceGroupName: string, frontDoorName: string, customDomainProperties: models.ValidateCustomDomainInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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, frontDoorName: string, frontDoorParameters: models.FrontDoor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new Front Door with a Front Door name under the specified + * subscription and resource group. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} frontDoorParameters Front Door properties needed to create a + * new Front Door. + * + * @param {string} [frontDoorParameters.friendlyName] A friendly name for the + * frontDoor + * + * @param {array} [frontDoorParameters.routingRules] Routing rules associated + * with this Front Door. + * + * @param {array} [frontDoorParameters.loadBalancingSettings] Load balancing + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.healthProbeSettings] Health probe + * settings associated with this Front Door instance. + * + * @param {array} [frontDoorParameters.backendPools] Backend pools available to + * routing rules. + * + * @param {array} [frontDoorParameters.frontendEndpoints] Frontend endpoints + * available to routing rules. + * + * @param {string} [frontDoorParameters.enabledState] Operational status of the + * Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [frontDoorParameters.resourceState] Resource status of the + * Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [frontDoorParameters.location] Resource location. + * + * @param {object} [frontDoorParameters.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 {FrontDoor} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontDoor} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoor} for more information. + * + * {WebResource} [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, frontDoorName: string, frontDoorParameters: models.FrontDoor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, frontDoorParameters: models.FrontDoor, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, frontDoorParameters: models.FrontDoor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing Front Door with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the Front Doors within an Azure 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>; + + /** + * Lists all of the Front Doors within an Azure 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 {FrontDoorListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontDoorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoorListResult} for more information. + * + * {WebResource} [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; + + + /** + * Lists all of the Front Doors within a resource group under 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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the Front Doors within a resource group under 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 {FrontDoorListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontDoorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FrontDoorListResult} for more information. + * + * {WebResource} [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 + * RoutingRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontdoorManagementClient. + */ +export interface RoutingRules { + + + /** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RoutingRuleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RoutingRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRuleListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, callback: ServiceCallback): void; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a Routing Rule with the specified Rule name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, routingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a Routing Rule with the specified Rule name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RoutingRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RoutingRule} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRule} for more information. + * + * {WebResource} [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, frontDoorName: string, routingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, frontDoorName: string, routingRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, frontDoorName: string, routingRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, routingRuleName: string, routingRuleParameters: models.RoutingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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 {RoutingRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RoutingRule} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRule} for more information. + * + * {WebResource} [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, frontDoorName: string, routingRuleName: string, routingRuleParameters: models.RoutingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, frontDoorName: string, routingRuleName: string, routingRuleParameters: models.RoutingRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, frontDoorName: string, routingRuleName: string, routingRuleParameters: models.RoutingRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, routingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, routingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, frontDoorName: string, routingRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, frontDoorName: string, routingRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, routingRuleName: string, routingRuleParameters: models.RoutingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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 {RoutingRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RoutingRule} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRule} for more information. + * + * {WebResource} [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, frontDoorName: string, routingRuleName: string, routingRuleParameters: models.RoutingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, routingRuleName: string, routingRuleParameters: models.RoutingRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, routingRuleName: string, routingRuleParameters: models.RoutingRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, routingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, routingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, routingRuleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, routingRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} nextPageLink The NextLink from the 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 {RoutingRuleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RoutingRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRuleListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoorNext(nextPageLink: string, callback: ServiceCallback): void; + listByFrontDoorNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * HealthProbeSettings + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontdoorManagementClient. + */ +export interface HealthProbeSettings { + + + /** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HealthProbeSettingsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HealthProbeSettingsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, callback: ServiceCallback): void; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a HealthProbeSettings with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, healthProbeSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a HealthProbeSettings with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HealthProbeSettingsModel} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HealthProbeSettingsModel} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsModel} for more + * information. + * + * {WebResource} [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, frontDoorName: string, healthProbeSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, healthProbeSettingsParameters: models.HealthProbeSettingsModel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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 {HealthProbeSettingsModel} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HealthProbeSettingsModel} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsModel} for more + * information. + * + * {WebResource} [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, frontDoorName: string, healthProbeSettingsName: string, healthProbeSettingsParameters: models.HealthProbeSettingsModel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, healthProbeSettingsParameters: models.HealthProbeSettingsModel, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, healthProbeSettingsParameters: models.HealthProbeSettingsModel, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, healthProbeSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, healthProbeSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, healthProbeSettingsParameters: models.HealthProbeSettingsModel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new HealthProbeSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} healthProbeSettingsParameters HealthProbeSettings properties + * needed to create a new Front Door. + * + * @param {string} [healthProbeSettingsParameters.path] The path to use for the + * health probe. Default is / + * + * @param {string} [healthProbeSettingsParameters.protocol] Protocol scheme to + * use for this probe. Possible values include: 'Http', 'Https' + * + * @param {number} [healthProbeSettingsParameters.intervalInSeconds] The number + * of seconds between health probes. + * + * @param {string} [healthProbeSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [healthProbeSettingsParameters.name] Resource name. + * + * @param {string} [healthProbeSettingsParameters.id] Resource 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 {HealthProbeSettingsModel} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HealthProbeSettingsModel} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsModel} for more + * information. + * + * {WebResource} [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, frontDoorName: string, healthProbeSettingsName: string, healthProbeSettingsParameters: models.HealthProbeSettingsModel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, healthProbeSettingsParameters: models.HealthProbeSettingsModel, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, healthProbeSettingsParameters: models.HealthProbeSettingsModel, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, healthProbeSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing HealthProbeSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} healthProbeSettingsName Name of the health probe settings + * which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, healthProbeSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, healthProbeSettingsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the HealthProbeSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the 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 {HealthProbeSettingsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HealthProbeSettingsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link HealthProbeSettingsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoorNext(nextPageLink: string, callback: ServiceCallback): void; + listByFrontDoorNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LoadBalancingSettings + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontdoorManagementClient. + */ +export interface LoadBalancingSettings { + + + /** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancingSettingsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LoadBalancingSettingsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, callback: ServiceCallback): void; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, loadBalancingSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LoadBalancingSettingsModel} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LoadBalancingSettingsModel} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsModel} for more + * information. + * + * {WebResource} [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, frontDoorName: string, loadBalancingSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, loadBalancingSettingsParameters: models.LoadBalancingSettingsModel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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 {LoadBalancingSettingsModel} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LoadBalancingSettingsModel} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsModel} for more + * information. + * + * {WebResource} [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, frontDoorName: string, loadBalancingSettingsName: string, loadBalancingSettingsParameters: models.LoadBalancingSettingsModel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, loadBalancingSettingsParameters: models.LoadBalancingSettingsModel, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, loadBalancingSettingsParameters: models.LoadBalancingSettingsModel, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, loadBalancingSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, loadBalancingSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, loadBalancingSettingsParameters: models.LoadBalancingSettingsModel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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 {LoadBalancingSettingsModel} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LoadBalancingSettingsModel} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsModel} for more + * information. + * + * {WebResource} [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, frontDoorName: string, loadBalancingSettingsName: string, loadBalancingSettingsParameters: models.LoadBalancingSettingsModel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, loadBalancingSettingsParameters: models.LoadBalancingSettingsModel, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, loadBalancingSettingsParameters: models.LoadBalancingSettingsModel, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, loadBalancingSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, loadBalancingSettingsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, loadBalancingSettingsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the 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 {LoadBalancingSettingsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LoadBalancingSettingsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoorNext(nextPageLink: string, callback: ServiceCallback): void; + listByFrontDoorNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * BackendPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontdoorManagementClient. + */ +export interface BackendPools { + + + /** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BackendPoolListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackendPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPoolListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, callback: ServiceCallback): void; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a Backend Pool with the specified Pool name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, backendPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a Backend Pool with the specified Pool name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BackendPool} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackendPool} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPool} for more information. + * + * {WebResource} [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, frontDoorName: string, backendPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, frontDoorName: string, backendPoolName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, frontDoorName: string, backendPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, backendPoolName: string, backendPoolParameters: models.BackendPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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 {BackendPool} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackendPool} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPool} for more information. + * + * {WebResource} [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, frontDoorName: string, backendPoolName: string, backendPoolParameters: models.BackendPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, frontDoorName: string, backendPoolName: string, backendPoolParameters: models.BackendPool, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, frontDoorName: string, backendPoolName: string, backendPoolParameters: models.BackendPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, backendPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, backendPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, frontDoorName: string, backendPoolName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, frontDoorName: string, backendPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, backendPoolName: string, backendPoolParameters: models.BackendPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new Backend Pool with the specified Pool name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} backendPoolParameters Backend Pool properties needed to + * create a new Pool. + * + * @param {array} [backendPoolParameters.backends] The set of backends for this + * pool + * + * @param {object} [backendPoolParameters.loadBalancingSettings] Load balancing + * settings for a backend pool + * + * @param {object} [backendPoolParameters.healthProbeSettings] L7 health probe + * settings for a backend pool + * + * @param {string} [backendPoolParameters.healthProbeSettings.id] Resource ID. + * + * @param {string} [backendPoolParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [backendPoolParameters.name] Resource name. + * + * @param {string} [backendPoolParameters.id] Resource 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 {BackendPool} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackendPool} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPool} for more information. + * + * {WebResource} [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, frontDoorName: string, backendPoolName: string, backendPoolParameters: models.BackendPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, backendPoolName: string, backendPoolParameters: models.BackendPool, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, backendPoolName: string, backendPoolParameters: models.BackendPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, backendPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing Backend Pool with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} backendPoolName Name of the Backend Pool which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, backendPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, backendPoolName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, backendPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the Backend Pools within a Front Door. + * + * @param {string} nextPageLink The NextLink from the 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 {BackendPoolListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackendPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackendPoolListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoorNext(nextPageLink: string, callback: ServiceCallback): void; + listByFrontDoorNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * FrontendEndpoints + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontdoorManagementClient. + */ +export interface FrontendEndpoints { + + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FrontendEndpointsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontendEndpointsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpointsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, callback: ServiceCallback): void; + listByFrontDoor(resourceGroupName: string, frontDoorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a Frontend endpoint with the specified name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a Frontend endpoint with the specified name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FrontendEndpoint} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontendEndpoint} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpoint} for more information. + * + * {WebResource} [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, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, frontendEndpointParameters: models.FrontendEndpoint, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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 {FrontendEndpoint} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontendEndpoint} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpoint} for more information. + * + * {WebResource} [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, frontDoorName: string, frontendEndpointName: string, frontendEndpointParameters: models.FrontendEndpoint, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, frontendEndpointParameters: models.FrontendEndpoint, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, frontendEndpointParameters: models.FrontendEndpoint, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + enableHttpsWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, customHttpsConfiguration: models.CustomHttpsConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {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. + */ + enableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, customHttpsConfiguration: models.CustomHttpsConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + enableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, customHttpsConfiguration: models.CustomHttpsConfiguration, callback: ServiceCallback): void; + enableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, customHttpsConfiguration: models.CustomHttpsConfiguration, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + disableHttpsWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + disableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + disableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, callback: ServiceCallback): void; + disableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, frontendEndpointParameters: models.FrontendEndpoint, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new frontend endpoint with the specified host name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} frontendEndpointParameters Frontend endpoint properties + * needed to create a new endpoint. + * + * @param {string} [frontendEndpointParameters.hostName] The host name of the + * frontendEndpoint. Must be a domain name. + * + * @param {string} [frontendEndpointParameters.sessionAffinityEnabledState] + * Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [frontendEndpointParameters.sessionAffinityTtlSeconds] + * UNUSED. This field will be ignored. The TTL to use in seconds for session + * affinity, if applicable. + * + * @param {object} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink] Defines the + * Web Application Firewall policy for each host (if applicable) + * + * @param {string} + * [frontendEndpointParameters.webApplicationFirewallPolicyLink.id] Resource + * ID. + * + * @param {string} [frontendEndpointParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [frontendEndpointParameters.name] Resource name. + * + * @param {string} [frontendEndpointParameters.id] Resource 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 {FrontendEndpoint} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontendEndpoint} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpoint} for more information. + * + * {WebResource} [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, frontDoorName: string, frontendEndpointName: string, frontendEndpointParameters: models.FrontendEndpoint, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, frontendEndpointParameters: models.FrontendEndpoint, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, frontendEndpointParameters: models.FrontendEndpoint, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing frontend endpoint with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginEnableHttpsWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, customHttpsConfiguration: models.CustomHttpsConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Enables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} customHttpsConfiguration The configuration specifying how to + * enable HTTPS + * + * @param {string} [customHttpsConfiguration.certificateSource] Defines the + * source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + * + * @param {string} [customHttpsConfiguration.protocolType] Defines the TLS + * extension protocol that is used for secure delivery. Possible values + * include: 'ServerNameIndication' + * + * @param {object} [customHttpsConfiguration.vault] The Key Vault containing + * the SSL certificate + * + * @param {string} [customHttpsConfiguration.vault.id] Resource ID. + * + * @param {string} [customHttpsConfiguration.secretName] The name of the Key + * Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.secretVersion] The version of the + * Key Vault secret representing the full certificate PFX + * + * @param {string} [customHttpsConfiguration.certificateType] Defines the type + * of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {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. + */ + beginEnableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, customHttpsConfiguration: models.CustomHttpsConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginEnableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, customHttpsConfiguration: models.CustomHttpsConfiguration, callback: ServiceCallback): void; + beginEnableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, customHttpsConfiguration: models.CustomHttpsConfiguration, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDisableHttpsWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Disables a frontendEndpoint for HTTPS traffic + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} frontendEndpointName Name of the Frontend endpoint which is + * unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + beginDisableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDisableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, callback: ServiceCallback): void; + beginDisableHttps(resourceGroupName: string, frontDoorName: string, frontendEndpointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the frontend endpoints within a Front Door. + * + * @param {string} nextPageLink The NextLink from the 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 {FrontendEndpointsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FrontendEndpointsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FrontendEndpointsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByFrontDoorNext(nextPageLink: string, callback: ServiceCallback): void; + listByFrontDoorNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Endpoints + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontdoorManagementClient. + */ +export interface Endpoints { + + + /** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + purgeContentWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, contentFilePaths: models.PurgeParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + purgeContent(resourceGroupName: string, frontDoorName: string, contentFilePaths: models.PurgeParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + purgeContent(resourceGroupName: string, frontDoorName: string, contentFilePaths: models.PurgeParameters, callback: ServiceCallback): void; + purgeContent(resourceGroupName: string, frontDoorName: string, contentFilePaths: models.PurgeParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginPurgeContentWithHttpOperationResponse(resourceGroupName: string, frontDoorName: string, contentFilePaths: models.PurgeParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Removes a content from Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} contentFilePaths The path to the content to be purged. Path + * can be a full URL, e.g. '/pictures/city.png' which removes a single file, or + * a directory with a wildcard, e.g. '/pictures/*' which removes all folders + * and files in the directory. + * + * @param {array} contentFilePaths.contentPaths The path to the content to be + * purged. Can describe a file path or a wild card directory. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + beginPurgeContent(resourceGroupName: string, frontDoorName: string, contentFilePaths: models.PurgeParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPurgeContent(resourceGroupName: string, frontDoorName: string, contentFilePaths: models.PurgeParameters, callback: ServiceCallback): void; + beginPurgeContent(resourceGroupName: string, frontDoorName: string, contentFilePaths: models.PurgeParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Policies + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontdoorManagementClient. + */ +export interface Policies { + + + /** + * Lists all of the protection policies within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the protection policies within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WebApplicationFirewallPolicyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebApplicationFirewallPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicyListResult} for + * more information. + * + * {WebResource} [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(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WebApplicationFirewallPolicy1} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebApplicationFirewallPolicy1} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicy1} for more + * information. + * + * {WebResource} [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, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, policyName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, policyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or update policy with specified ruleset name within a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes policySettings for + * policy + * + * @param {string} [parameters.policySettings.enabledState] describes if the + * policy is in enabled state or disabled state. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy + * + * @param {array} [parameters.managedRules.ruleSets] List of rules + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.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, policyName: string, parameters: models.WebApplicationFirewallPolicy1, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or update policy with specified ruleset name within a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes policySettings for + * policy + * + * @param {string} [parameters.policySettings.enabledState] describes if the + * policy is in enabled state or disabled state. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy + * + * @param {array} [parameters.managedRules.ruleSets] List of rules + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.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 {WebApplicationFirewallPolicy1} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebApplicationFirewallPolicy1} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicy1} for more + * information. + * + * {WebResource} [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, policyName: string, parameters: models.WebApplicationFirewallPolicy1, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, policyName: string, parameters: models.WebApplicationFirewallPolicy1, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, policyName: string, parameters: models.WebApplicationFirewallPolicy1, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, policyName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, policyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, policyName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, policyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the protection policies within 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. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the protection policies within 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 {WebApplicationFirewallPolicyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebApplicationFirewallPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicyListResult} for + * more information. + * + * {WebResource} [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; +} diff --git a/lib/services/frontdoorManagement/lib/operations/index.js b/lib/services/frontdoorManagement/lib/operations/index.js new file mode 100644 index 0000000000..598f43eee3 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/index.js @@ -0,0 +1,24 @@ +/* + * 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'; + +exports.FrontDoors = require('./frontDoors'); +exports.RoutingRules = require('./routingRules'); +exports.HealthProbeSettings = require('./healthProbeSettings'); +exports.LoadBalancingSettings = require('./loadBalancingSettings'); +exports.BackendPools = require('./backendPools'); +exports.FrontendEndpoints = require('./frontendEndpoints'); +exports.Endpoints = require('./endpoints'); +exports.Policies = require('./policies'); diff --git a/lib/services/frontdoorManagement/lib/operations/loadBalancingSettings.js b/lib/services/frontdoorManagement/lib/operations/loadBalancingSettings.js new file mode 100644 index 0000000000..a70f1d0717 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/loadBalancingSettings.js @@ -0,0 +1,1910 @@ +/* + * 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; + +/** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoor(resourceGroupName, frontDoorName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LoadBalancingSettingsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsModel} for more + * information. + * + * {object} [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, frontDoorName, loadBalancingSettingsName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (loadBalancingSettingsName === null || loadBalancingSettingsName === undefined || typeof loadBalancingSettingsName.valueOf() !== 'string') { + throw new Error('loadBalancingSettingsName cannot be null or undefined and it must be of type string.'); + } + if (loadBalancingSettingsName !== null && loadBalancingSettingsName !== undefined) { + if (loadBalancingSettingsName.length > 90) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "MaxLength": 90'); + } + if (loadBalancingSettingsName.length < 1) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "MinLength": 1'); + } + if (loadBalancingSettingsName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{loadBalancingSettingsName}', encodeURIComponent(loadBalancingSettingsName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LoadBalancingSettingsModel']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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 LoadBalancingSettingsModel} for more + * information. + * + * {object} [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, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, callback) { + /* jshint 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, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, 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['LoadBalancingSettingsModel']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, loadBalancingSettingsName, options, callback) { + /* jshint 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, frontDoorName, loadBalancingSettingsName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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 LoadBalancingSettingsModel} for more + * information. + * + * {object} [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, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (loadBalancingSettingsName === null || loadBalancingSettingsName === undefined || typeof loadBalancingSettingsName.valueOf() !== 'string') { + throw new Error('loadBalancingSettingsName cannot be null or undefined and it must be of type string.'); + } + if (loadBalancingSettingsName !== null && loadBalancingSettingsName !== undefined) { + if (loadBalancingSettingsName.length > 90) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "MaxLength": 90'); + } + if (loadBalancingSettingsName.length < 1) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "MinLength": 1'); + } + if (loadBalancingSettingsName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (loadBalancingSettingsParameters === null || loadBalancingSettingsParameters === undefined) { + throw new Error('loadBalancingSettingsParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{loadBalancingSettingsName}', encodeURIComponent(loadBalancingSettingsName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (loadBalancingSettingsParameters !== null && loadBalancingSettingsParameters !== undefined) { + let requestModelMapper = new client.models['LoadBalancingSettingsModel']().mapper(); + requestModel = client.serialize(requestModelMapper, loadBalancingSettingsParameters, 'loadBalancingSettingsParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(loadBalancingSettingsParameters, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LoadBalancingSettingsModel']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['LoadBalancingSettingsModel']().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['LoadBalancingSettingsModel']().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); + }); +} + +/** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, loadBalancingSettingsName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (loadBalancingSettingsName === null || loadBalancingSettingsName === undefined || typeof loadBalancingSettingsName.valueOf() !== 'string') { + throw new Error('loadBalancingSettingsName cannot be null or undefined and it must be of type string.'); + } + if (loadBalancingSettingsName !== null && loadBalancingSettingsName !== undefined) { + if (loadBalancingSettingsName.length > 90) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "MaxLength": 90'); + } + if (loadBalancingSettingsName.length < 1) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "MinLength": 1'); + } + if (loadBalancingSettingsName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"loadBalancingSettingsName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{loadBalancingSettingsName}', encodeURIComponent(loadBalancingSettingsName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 LoadBalancingSettingsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoorNext(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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LoadBalancingSettingsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 LoadBalancingSettings. */ +class LoadBalancingSettings { + /** + * Create a LoadBalancingSettings. + * @param {FrontdoorManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByFrontDoor = _listByFrontDoor; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByFrontDoorNext = _listByFrontDoorNext; + } + + /** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName, frontDoorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LoadBalancingSettingsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback); + } + } + + /** + * Gets a LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, loadBalancingSettingsName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, frontDoorName, loadBalancingSettingsName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LoadBalancingSettingsModel} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsModel} for more + * information. + * + * {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, frontDoorName, loadBalancingSettingsName, options, optionalCallback) { + 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, frontDoorName, loadBalancingSettingsName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, frontDoorName, loadBalancingSettingsName, options, optionalCallback); + } + } + + /** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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 {LoadBalancingSettingsModel} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsModel} for more + * information. + * + * {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, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, optionalCallback) { + 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, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, loadBalancingSettingsName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, frontDoorName, loadBalancingSettingsName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, loadBalancingSettingsName, options, optionalCallback) { + 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, frontDoorName, loadBalancingSettingsName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, frontDoorName, loadBalancingSettingsName, options, optionalCallback); + } + } + + /** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new LoadBalancingSettings with the specified Rule name within the + * specified Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} loadBalancingSettingsParameters LoadBalancingSettings + * properties needed to create a new Front Door. + * + * @param {number} [loadBalancingSettingsParameters.sampleSize] The number of + * samples to consider for load balancing decisions + * + * @param {number} [loadBalancingSettingsParameters.successfulSamplesRequired] + * The number of samples within the sample period that must succeed + * + * @param {number} + * [loadBalancingSettingsParameters.additionalLatencyMilliseconds] The + * additional latency in milliseconds for probes to fall into the lowest + * latency bucket + * + * @param {string} [loadBalancingSettingsParameters.resourceState] Resource + * status. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + * + * @param {string} [loadBalancingSettingsParameters.name] Resource name. + * + * @param {string} [loadBalancingSettingsParameters.id] Resource 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 {LoadBalancingSettingsModel} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsModel} for more + * information. + * + * {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, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, optionalCallback) { + 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, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, loadBalancingSettingsName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, frontDoorName, loadBalancingSettingsName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing LoadBalancingSettings with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} loadBalancingSettingsName Name of the load balancing + * settings which is unique within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, loadBalancingSettingsName, options, optionalCallback) { + 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, frontDoorName, loadBalancingSettingsName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, frontDoorName, loadBalancingSettingsName, options, optionalCallback); + } + } + + /** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the LoadBalancingSettings within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 {LoadBalancingSettingsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LoadBalancingSettingsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(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._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoorNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LoadBalancingSettings; diff --git a/lib/services/frontdoorManagement/lib/operations/policies.js b/lib/services/frontdoorManagement/lib/operations/policies.js new file mode 100644 index 0000000000..14c41cd632 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/policies.js @@ -0,0 +1,1438 @@ +/* + * 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; + +/** + * Lists all of the protection policies within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicyListResult} for + * more information. + * + * {object} [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(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 apiVersion = '2018-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebApplicationFirewallPolicyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Retrieve protection policy with specified name within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicy1} for more + * information. + * + * {object} [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, policyName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (policyName === null || policyName === undefined || typeof policyName.valueOf() !== 'string') { + throw new Error('policyName cannot be null or undefined and it must be of type string.'); + } + if (policyName !== null && policyName !== undefined) { + if (policyName.length > 128) + { + throw new Error('"policyName" should satisfy the constraint - "MaxLength": 128'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebApplicationFirewallPolicy1']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates or update policy with specified ruleset name within a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes policySettings for + * policy + * + * @param {string} [parameters.policySettings.enabledState] describes if the + * policy is in enabled state or disabled state. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy + * + * @param {array} [parameters.managedRules.ruleSets] List of rules + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.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 WebApplicationFirewallPolicy1} for more + * information. + * + * {object} [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, policyName, 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.'); + } + let apiVersion = '2018-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (policyName === null || policyName === undefined || typeof policyName.valueOf() !== 'string') { + throw new Error('policyName cannot be null or undefined and it must be of type string.'); + } + if (policyName !== null && policyName !== undefined) { + if (policyName.length > 128) + { + throw new Error('"policyName" should satisfy the constraint - "MaxLength": 128'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['WebApplicationFirewallPolicy1']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebApplicationFirewallPolicy1']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['WebApplicationFirewallPolicy1']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, policyName, options, callback) { + /* jshint 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, policyName, 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); + }); + }); +} + +/** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, policyName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (policyName === null || policyName === undefined || typeof policyName.valueOf() !== 'string') { + throw new Error('policyName cannot be null or undefined and it must be of type string.'); + } + if (policyName !== null && policyName !== undefined) { + if (policyName.length > 128) + { + throw new Error('"policyName" should satisfy the constraint - "MaxLength": 128'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the protection policies within 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 WebApplicationFirewallPolicyListResult} for + * more information. + * + * {object} [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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebApplicationFirewallPolicyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Policies. */ +class Policies { + /** + * Create a Policies. + * @param {FrontdoorManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._beginDeleteMethod = _beginDeleteMethod; + this._listNext = _listNext; + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WebApplicationFirewallPolicyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicyListResult} for + * more information. + * + * {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(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._list(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, policyName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, policyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WebApplicationFirewallPolicy1} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicy1} for more + * information. + * + * {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, policyName, options, optionalCallback) { + 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, policyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, policyName, options, optionalCallback); + } + } + + /** + * Creates or update policy with specified ruleset name within a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes policySettings for + * policy + * + * @param {string} [parameters.policySettings.enabledState] describes if the + * policy is in enabled state or disabled state. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy + * + * @param {array} [parameters.managedRules.ruleSets] List of rules + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.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, policyName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, policyName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or update policy with specified ruleset name within a resource + * group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes policySettings for + * policy + * + * @param {string} [parameters.policySettings.enabledState] describes if the + * policy is in enabled state or disabled state. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy + * + * @param {array} [parameters.managedRules.ruleSets] List of rules + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.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 {WebApplicationFirewallPolicy1} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicy1} for more + * information. + * + * {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, policyName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, policyName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, policyName, parameters, options, optionalCallback); + } + } + + /** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, policyName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, policyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, policyName, options, optionalCallback) { + 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, policyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, policyName, options, optionalCallback); + } + } + + /** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, policyName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, policyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes Policy + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} policyName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, policyName, options, optionalCallback) { + 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, policyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, policyName, options, optionalCallback); + } + } + + /** + * Lists all of the protection policies within 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. + */ + 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; + }); + }); + } + + /** + * Lists all of the protection policies within 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 {WebApplicationFirewallPolicyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicyListResult} for + * more information. + * + * {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 = Policies; diff --git a/lib/services/frontdoorManagement/lib/operations/routingRules.js b/lib/services/frontdoorManagement/lib/operations/routingRules.js new file mode 100644 index 0000000000..ab33e89cd5 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/routingRules.js @@ -0,0 +1,2068 @@ +/* + * 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; + +/** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRuleListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoor(resourceGroupName, frontDoorName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RoutingRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a Routing Rule with the specified Rule name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRule} for more information. + * + * {object} [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, frontDoorName, routingRuleName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (routingRuleName === null || routingRuleName === undefined || typeof routingRuleName.valueOf() !== 'string') { + throw new Error('routingRuleName cannot be null or undefined and it must be of type string.'); + } + if (routingRuleName !== null && routingRuleName !== undefined) { + if (routingRuleName.length > 90) + { + throw new Error('"routingRuleName" should satisfy the constraint - "MaxLength": 90'); + } + if (routingRuleName.length < 1) + { + throw new Error('"routingRuleName" should satisfy the constraint - "MinLength": 1'); + } + if (routingRuleName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"routingRuleName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{routingRuleName}', encodeURIComponent(routingRuleName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RoutingRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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 RoutingRule} for more information. + * + * {object} [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, frontDoorName, routingRuleName, routingRuleParameters, options, callback) { + /* jshint 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, frontDoorName, routingRuleName, routingRuleParameters, 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['RoutingRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, routingRuleName, options, callback) { + /* jshint 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, frontDoorName, routingRuleName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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 RoutingRule} for more information. + * + * {object} [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, frontDoorName, routingRuleName, routingRuleParameters, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (routingRuleName === null || routingRuleName === undefined || typeof routingRuleName.valueOf() !== 'string') { + throw new Error('routingRuleName cannot be null or undefined and it must be of type string.'); + } + if (routingRuleName !== null && routingRuleName !== undefined) { + if (routingRuleName.length > 90) + { + throw new Error('"routingRuleName" should satisfy the constraint - "MaxLength": 90'); + } + if (routingRuleName.length < 1) + { + throw new Error('"routingRuleName" should satisfy the constraint - "MinLength": 1'); + } + if (routingRuleName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"routingRuleName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (routingRuleParameters === null || routingRuleParameters === undefined) { + throw new Error('routingRuleParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{routingRuleName}', encodeURIComponent(routingRuleName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (routingRuleParameters !== null && routingRuleParameters !== undefined) { + let requestModelMapper = new client.models['RoutingRule']().mapper(); + requestModel = client.serialize(requestModelMapper, routingRuleParameters, 'routingRuleParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(routingRuleParameters, 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RoutingRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['RoutingRule']().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['RoutingRule']().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); + }); +} + +/** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, frontDoorName, routingRuleName, options, callback) { + /* jshint 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 apiVersion = '2018-08-01'; + // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } + if (frontDoorName === null || frontDoorName === undefined || typeof frontDoorName.valueOf() !== 'string') { + throw new Error('frontDoorName cannot be null or undefined and it must be of type string.'); + } + if (frontDoorName !== null && frontDoorName !== undefined) { + if (frontDoorName.length > 64) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MaxLength": 64'); + } + if (frontDoorName.length < 5) + { + throw new Error('"frontDoorName" should satisfy the constraint - "MinLength": 5'); + } + if (frontDoorName.match(/^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/) === null) + { + throw new Error('"frontDoorName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$/'); + } + } + if (routingRuleName === null || routingRuleName === undefined || typeof routingRuleName.valueOf() !== 'string') { + throw new Error('routingRuleName cannot be null or undefined and it must be of type string.'); + } + if (routingRuleName !== null && routingRuleName !== undefined) { + if (routingRuleName.length > 90) + { + throw new Error('"routingRuleName" should satisfy the constraint - "MaxLength": 90'); + } + if (routingRuleName.length < 1) + { + throw new Error('"routingRuleName" should satisfy the constraint - "MinLength": 1'); + } + if (routingRuleName.match(/^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/) === null) + { + throw new Error('"routingRuleName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); + requestUrl = requestUrl.replace('{routingRuleName}', encodeURIComponent(routingRuleName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 RoutingRuleListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByFrontDoorNext(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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RoutingRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 RoutingRules. */ +class RoutingRules { + /** + * Create a RoutingRules. + * @param {FrontdoorManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByFrontDoor = _listByFrontDoor; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByFrontDoorNext = _listByFrontDoorNext; + } + + /** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorWithHttpOperationResponse(resourceGroupName, frontDoorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RoutingRuleListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRuleListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByFrontDoor(resourceGroupName, frontDoorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoor(resourceGroupName, frontDoorName, options, optionalCallback); + } + } + + /** + * Gets a Routing Rule with the specified Rule name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, routingRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, frontDoorName, routingRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a Routing Rule with the specified Rule name within the specified Front + * Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RoutingRule} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRule} for more information. + * + * {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, frontDoorName, routingRuleName, options, optionalCallback) { + 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, frontDoorName, routingRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, frontDoorName, routingRuleName, options, optionalCallback); + } + } + + /** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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 {RoutingRule} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRule} for more information. + * + * {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, frontDoorName, routingRuleName, routingRuleParameters, options, optionalCallback) { + 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, frontDoorName, routingRuleName, routingRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, routingRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, frontDoorName, routingRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, routingRuleName, options, optionalCallback) { + 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, frontDoorName, routingRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, frontDoorName, routingRuleName, options, optionalCallback); + } + } + + /** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new Routing Rule with the specified Rule name within the specified + * Front Door. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} routingRuleParameters Routing Rule properties needed to + * create a new Front Door. + * + * @param {array} [routingRuleParameters.frontendEndpoints] Frontend endpoints + * associated with this rule + * + * @param {array} [routingRuleParameters.acceptedProtocols] Protocol schemes to + * match for this rule + * + * @param {array} [routingRuleParameters.patternsToMatch] The route patterns of + * the rule. + * + * @param {string} [routingRuleParameters.customForwardingPath] A custom path + * used to rewrite resource paths matched by this rule. Leave empty to use + * incoming path. + * + * @param {string} [routingRuleParameters.forwardingProtocol] Protocol this + * rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + * + * @param {object} [routingRuleParameters.cacheConfiguration] The caching + * configuration associated with this rule. + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.queryParameterStripDirective] + * Treatment of URL query terms when forming the cache key. Possible values + * include: 'StripNone', 'StripAll' + * + * @param {string} + * [routingRuleParameters.cacheConfiguration.dynamicCompression] Whether to use + * dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [routingRuleParameters.backendPool] A reference to the + * BackendPool which this rule routes to. + * + * @param {string} [routingRuleParameters.backendPool.id] Resource ID. + * + * @param {string} [routingRuleParameters.enabledState] Whether to enable use + * of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [routingRuleParameters.resourceState] Resource status. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + * + * @param {string} [routingRuleParameters.name] Resource name. + * + * @param {string} [routingRuleParameters.id] Resource 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 {RoutingRule} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRule} for more information. + * + * {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, frontDoorName, routingRuleName, routingRuleParameters, options, optionalCallback) { + 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, frontDoorName, routingRuleName, routingRuleParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, options, optionalCallback); + } + } + + /** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, frontDoorName, routingRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, frontDoorName, routingRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an existing Routing Rule with the specified parameters. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} frontDoorName Name of the Front Door which is globally + * unique. + * + * @param {string} routingRuleName Name of the Routing Rule which is unique + * within the Front Door. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, frontDoorName, routingRuleName, options, optionalCallback) { + 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, frontDoorName, routingRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, frontDoorName, routingRuleName, options, optionalCallback); + } + } + + /** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByFrontDoorNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the Routing Rules within a Front Door. + * + * @param {string} nextPageLink The NextLink from the previous 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 {RoutingRuleListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RoutingRuleListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByFrontDoorNext(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._listByFrontDoorNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByFrontDoorNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = RoutingRules; diff --git a/lib/services/frontdoorManagement/package.json b/lib/services/frontdoorManagement/package.json new file mode 100644 index 0000000000..16c8a13bfb --- /dev/null +++ b/lib/services/frontdoorManagement/package.json @@ -0,0 +1,25 @@ +{ + "name": "azure-arm-frontdoor", + "author": "Microsoft Corporation", + "description": "FrontdoorManagementClient Library with typescript type definitions for node", + "version": "2.0.0-preview", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ + "node", + "azure" + ], + "license": "MIT", + "main": "./lib/frontdoorManagementClient.js", + "types": "./lib/frontdoorManagementClient.d.ts", + "homepage": "https://github.com/azure/azure-sdk-for-node", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-node/issues" + } +} diff --git a/lib/services/keyvault/LICENSE.txt b/lib/services/keyvault/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/keyvault/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/keyvault/lib/keyVaultClient.d.ts b/lib/services/keyvault/lib/keyVaultClient.d.ts new file mode 100644 index 0000000000..23a310181a --- /dev/null +++ b/lib/services/keyvault/lib/keyVaultClient.d.ts @@ -0,0 +1,7972 @@ +/* + * 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"; + +export default class KeyVaultClient extends AzureServiceClient { + /** + * Initializes a new instance of the KeyVaultClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @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, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + + + /** + * @summary Creates a new key, stores it, then returns key parameters and + * attributes to the client. + * + * The create key operation can be used to create any key type in Azure Key + * Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. It requires the keys/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name for the new key. The system will generate + * the version name for the new key. + * + * @param {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bits. For example: 2048, + * 3072, or 4096 for RSA. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, kty: string, options?: { keySize? : number, keyOps? : string[], keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, curve? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new key, stores it, then returns key parameters and + * attributes to the client. + * + * The create key operation can be used to create any key type in Azure Key + * Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. It requires the keys/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name for the new key. The system will generate + * the version name for the new key. + * + * @param {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bits. For example: 2048, + * 3072, or 4096 for RSA. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyBundle} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createKey(vaultBaseUrl: string, keyName: string, kty: string, options?: { keySize? : number, keyOps? : string[], keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, curve? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + createKey(vaultBaseUrl: string, keyName: string, kty: string, callback: ServiceCallback): void; + createKey(vaultBaseUrl: string, keyName: string, kty: string, options: { keySize? : number, keyOps? : string[], keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, curve? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Imports an externally created key, stores it, and returns key + * parameters and attributes to the client. + * + * The import key operation may be used to import any key type into an Azure + * Key Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. This operation requires the keys/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName Name for the imported key. + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key identifier. + * + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus. + * + * @param {buffer} [key.e] RSA public exponent. + * + * @param {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * + * @param {buffer} [key.dp] RSA private key parameter. + * + * @param {buffer} [key.dq] RSA private key parameter. + * + * @param {buffer} [key.qi] RSA private key parameter. + * + * @param {buffer} [key.p] RSA secret prime. + * + * @param {buffer} [key.q] RSA secret prime, with p < q. + * + * @param {buffer} [key.k] Symmetric key. + * + * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * + * @param {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {buffer} [key.x] X component of an EC public key. + * + * @param {buffer} [key.y] Y component of an EC public key. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key. + * + * @param {object} [options.keyAttributes] The key management attributes. + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + importKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, key: models.JsonWebKey, options?: { hsm? : boolean, keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Imports an externally created key, stores it, and returns key + * parameters and attributes to the client. + * + * The import key operation may be used to import any key type into an Azure + * Key Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. This operation requires the keys/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName Name for the imported key. + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key identifier. + * + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus. + * + * @param {buffer} [key.e] RSA public exponent. + * + * @param {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * + * @param {buffer} [key.dp] RSA private key parameter. + * + * @param {buffer} [key.dq] RSA private key parameter. + * + * @param {buffer} [key.qi] RSA private key parameter. + * + * @param {buffer} [key.p] RSA secret prime. + * + * @param {buffer} [key.q] RSA secret prime, with p < q. + * + * @param {buffer} [key.k] Symmetric key. + * + * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * + * @param {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {buffer} [key.x] X component of an EC public key. + * + * @param {buffer} [key.y] Y component of an EC public key. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key. + * + * @param {object} [options.keyAttributes] The key management attributes. + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyBundle} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + importKey(vaultBaseUrl: string, keyName: string, key: models.JsonWebKey, options?: { hsm? : boolean, keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + importKey(vaultBaseUrl: string, keyName: string, key: models.JsonWebKey, callback: ServiceCallback): void; + importKey(vaultBaseUrl: string, keyName: string, key: models.JsonWebKey, options: { hsm? : boolean, keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a key of any type from storage in Azure Key Vault. + * + * The delete key operation cannot be used to remove individual versions of a + * key. This operation removes the cryptographic material associated with the + * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or + * Encrypt/Decrypt operations. This operation requires the keys/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a key of any type from storage in Azure Key Vault. + * + * The delete key operation cannot be used to remove individual versions of a + * key. This operation removes the cryptographic material associated with the + * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or + * Encrypt/Decrypt operations. This operation requires the keys/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedKeyBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedKeyBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteKey(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteKey(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + deleteKey(vaultBaseUrl: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary The update key operation changes specified attributes of a stored + * key and can be applied to any key type and key version stored in Azure Key + * Vault. + * + * In order to perform this operation, the key must already exist in the Key + * Vault. Note: The cryptographic material of a key itself cannot be changed. + * This operation requires the keys/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of key to update. + * + * @param {string} keyVersion The version of the key to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, keyVersion: string, options?: { keyOps? : string[], keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary The update key operation changes specified attributes of a stored + * key and can be applied to any key type and key version stored in Azure Key + * Vault. + * + * In order to perform this operation, the key must already exist in the Key + * Vault. Note: The cryptographic material of a key itself cannot be changed. + * This operation requires the keys/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of key to update. + * + * @param {string} keyVersion The version of the key to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyBundle} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateKey(vaultBaseUrl: string, keyName: string, keyVersion: string, options?: { keyOps? : string[], keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + updateKey(vaultBaseUrl: string, keyName: string, keyVersion: string, callback: ServiceCallback): void; + updateKey(vaultBaseUrl: string, keyName: string, keyVersion: string, options: { keyOps? : string[], keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the public part of a stored key. + * + * The get key operation is applicable to all key types. If the requested key + * is symmetric, then no key material is released in the response. This + * operation requires the keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to get. + * + * @param {string} keyVersion Adding the version parameter retrieves a specific + * version of a key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, keyVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the public part of a stored key. + * + * The get key operation is applicable to all key types. If the requested key + * is symmetric, then no key material is released in the response. This + * operation requires the keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to get. + * + * @param {string} keyVersion Adding the version parameter retrieves a specific + * version of a key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyBundle} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getKey(vaultBaseUrl: string, keyName: string, keyVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getKey(vaultBaseUrl: string, keyName: string, keyVersion: string, callback: ServiceCallback): void; + getKey(vaultBaseUrl: string, keyName: string, keyVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getKeyVersionsWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getKeyVersions(vaultBaseUrl: string, keyName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getKeyVersions(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + getKeyVersions(vaultBaseUrl: string, keyName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getKeysWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getKeys(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getKeys(vaultBaseUrl: string, callback: ServiceCallback): void; + getKeys(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Requests that a backup of the specified key be downloaded to the + * client. + * + * The Key Backup operation exports a key from Azure Key Vault in a protected + * form. Note that this operation does NOT return key material in a form that + * can be used outside the Azure Key Vault system, the returned key material is + * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The + * intent of this operation is to allow a client to GENERATE a key in one Azure + * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure + * Key Vault instance. The BACKUP operation may be used to export, in protected + * form, any key type from Azure Key Vault. Individual versions of a key cannot + * be backed up. BACKUP / RESTORE can be performed within geographical + * boundaries only; meaning that a BACKUP from one geographical area cannot be + * restored to another geographical area. For example, a backup from the US + * geographical area cannot be restored in an EU geographical area. This + * operation requires the key/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + backupKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Requests that a backup of the specified key be downloaded to the + * client. + * + * The Key Backup operation exports a key from Azure Key Vault in a protected + * form. Note that this operation does NOT return key material in a form that + * can be used outside the Azure Key Vault system, the returned key material is + * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The + * intent of this operation is to allow a client to GENERATE a key in one Azure + * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure + * Key Vault instance. The BACKUP operation may be used to export, in protected + * form, any key type from Azure Key Vault. Individual versions of a key cannot + * be backed up. BACKUP / RESTORE can be performed within geographical + * boundaries only; meaning that a BACKUP from one geographical area cannot be + * restored to another geographical area. For example, a backup from the US + * geographical area cannot be restored in an EU geographical area. This + * operation requires the key/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BackupKeyResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackupKeyResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackupKeyResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + backupKey(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backupKey(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + backupKey(vaultBaseUrl: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a backed up key to a vault. + * + * Imports a previously backed up key into Azure Key Vault, restoring the key, + * its key identifier, attributes and access control policies. The RESTORE + * operation may be used to import a previously backed up key. Individual + * versions of a key cannot be restored. The key is restored in its entirety + * with the same key name as it had when it was backed up. If the key name is + * not available in the target Key Vault, the RESTORE operation will be + * rejected. While the key name is retained during restore, the final key + * identifier will change if the key is restored to a different vault. Restore + * will restore all versions and preserve version identifiers. The RESTORE + * operation is subject to security constraints: The target Key Vault must be + * owned by the same Microsoft Azure Subscription as the source Key Vault The + * user must have RESTORE permission in the target Key Vault. This operation + * requires the keys/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} keyBundleBackup The backup blob associated with a key + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + restoreKeyWithHttpOperationResponse(vaultBaseUrl: string, keyBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a backed up key to a vault. + * + * Imports a previously backed up key into Azure Key Vault, restoring the key, + * its key identifier, attributes and access control policies. The RESTORE + * operation may be used to import a previously backed up key. Individual + * versions of a key cannot be restored. The key is restored in its entirety + * with the same key name as it had when it was backed up. If the key name is + * not available in the target Key Vault, the RESTORE operation will be + * rejected. While the key name is retained during restore, the final key + * identifier will change if the key is restored to a different vault. Restore + * will restore all versions and preserve version identifiers. The RESTORE + * operation is subject to security constraints: The target Key Vault must be + * owned by the same Microsoft Azure Subscription as the source Key Vault The + * user must have RESTORE permission in the target Key Vault. This operation + * requires the keys/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} keyBundleBackup The backup blob associated with a key + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyBundle} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + restoreKey(vaultBaseUrl: string, keyBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreKey(vaultBaseUrl: string, keyBundleBackup: Buffer, callback: ServiceCallback): void; + restoreKey(vaultBaseUrl: string, keyBundleBackup: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Encrypts an arbitrary sequence of bytes using an encryption key + * that is stored in a key vault. + * + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an + * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT + * operation only supports a single block of data, the size of which is + * dependent on the target key and the encryption algorithm to be used. The + * ENCRYPT operation is only strictly necessary for symmetric keys stored in + * Azure Key Vault since protection with an asymmetric key can be performed + * using public portion of the key. This operation is supported for asymmetric + * keys as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/encypt + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + encryptWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Encrypts an arbitrary sequence of bytes using an encryption key + * that is stored in a key vault. + * + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an + * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT + * operation only supports a single block of data, the size of which is + * dependent on the target key and the encryption algorithm to be used. The + * ENCRYPT operation is only strictly necessary for symmetric keys stored in + * Azure Key Vault since protection with an asymmetric key can be performed + * using public portion of the key. This operation is supported for asymmetric + * keys as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/encypt + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Decrypts a single block of encrypted data. + * + * The DECRYPT operation decrypts a well-formed block of ciphertext using the + * target encryption key and specified algorithm. This operation is the reverse + * of the ENCRYPT operation; only a single block of data may be decrypted, the + * size of this block is dependent on the target key and the algorithm to be + * used. The DECRYPT operation applies to asymmetric and symmetric keys stored + * in Azure Key Vault since it uses the private portion of the key. This + * operation requires the keys/decrypt permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + decryptWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Decrypts a single block of encrypted data. + * + * The DECRYPT operation decrypts a well-formed block of ciphertext using the + * target encryption key and specified algorithm. This operation is the reverse + * of the ENCRYPT operation; only a single block of data may be decrypted, the + * size of this block is dependent on the target key and the algorithm to be + * used. The DECRYPT operation applies to asymmetric and symmetric keys stored + * in Azure Key Vault since it uses the private portion of the key. This + * operation requires the keys/decrypt permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a signature from a digest using the specified key. + * + * The SIGN operation is applicable to asymmetric and symmetric keys stored in + * Azure Key Vault since this operation uses the private portion of the key. + * This operation requires the keys/sign permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm identifier. For + * more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + signWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a signature from a digest using the specified key. + * + * The SIGN operation is applicable to asymmetric and symmetric keys stored in + * Azure Key Vault since this operation uses the private portion of the key. + * This operation requires the keys/sign permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm identifier. For + * more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + sign(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + sign(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + sign(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Verifies a signature using a specified key. + * + * The VERIFY operation is applicable to symmetric keys stored in Azure Key + * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure + * Key Vault since signature verification can be performed using the public + * portion of the key but this operation is supported as a convenience for + * callers that only have a key-reference and not the public portion of the + * key. This operation requires the keys/verify permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * + * @param {buffer} digest The digest used for signing. + * + * @param {buffer} signature The signature to be verified. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + verifyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, digest: Buffer, signature: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Verifies a signature using a specified key. + * + * The VERIFY operation is applicable to symmetric keys stored in Azure Key + * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure + * Key Vault since signature verification can be performed using the public + * portion of the key but this operation is supported as a convenience for + * callers that only have a key-reference and not the public portion of the + * key. This operation requires the keys/verify permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * + * @param {buffer} digest The digest used for signing. + * + * @param {buffer} signature The signature to be verified. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyVerifyResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyVerifyResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyVerifyResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + verify(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, digest: Buffer, signature: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + verify(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, digest: Buffer, signature: Buffer, callback: ServiceCallback): void; + verify(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, digest: Buffer, signature: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Wraps a symmetric key using a specified key. + * + * The WRAP operation supports encryption of a symmetric key using a key + * encryption key that has previously been stored in an Azure Key Vault. The + * WRAP operation is only strictly necessary for symmetric keys stored in Azure + * Key Vault since protection with an asymmetric key can be performed using the + * public portion of the key. This operation is supported for asymmetric keys + * as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/wrapKey + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + wrapKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Wraps a symmetric key using a specified key. + * + * The WRAP operation supports encryption of a symmetric key using a key + * encryption key that has previously been stored in an Azure Key Vault. The + * WRAP operation is only strictly necessary for symmetric keys stored in Azure + * Key Vault since protection with an asymmetric key can be performed using the + * public portion of the key. This operation is supported for asymmetric keys + * as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/wrapKey + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Unwraps a symmetric key using the specified key that was initially + * used for wrapping that key. + * + * The UNWRAP operation supports decryption of a symmetric key using the target + * key encryption key. This operation is the reverse of the WRAP operation. The + * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure + * Key Vault since it uses the private portion of the key. This operation + * requires the keys/unwrapKey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + unwrapKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Unwraps a symmetric key using the specified key that was initially + * used for wrapping that key. + * + * The UNWRAP operation supports decryption of a symmetric key using the target + * key encryption key. This operation is the reverse of the WRAP operation. The + * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure + * Key Vault since it uses the private portion of the key. This operation + * requires the keys/unwrapKey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedKeysWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedKeyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedKeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedKeys(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedKeys(vaultBaseUrl: string, callback: ServiceCallback): void; + getDeletedKeys(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the public part of a deleted key. + * + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. + * While the operation can be invoked on any vault, it will return an error if + * invoked on a non soft-delete enabled vault. This operation requires the + * keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the public part of a deleted key. + * + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. + * While the operation can be invoked on any vault, it will return an error if + * invoked on a non soft-delete enabled vault. This operation requires the + * keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedKeyBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedKeyBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedKey(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedKey(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + getDeletedKey(vaultBaseUrl: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Permanently deletes the specified key. + * + * The Purge Deleted Key operation is applicable for soft-delete enabled + * vaults. While the operation can be invoked on any vault, it will return an + * error if invoked on a non soft-delete enabled vault. This operation requires + * the keys/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + purgeDeletedKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Permanently deletes the specified key. + * + * The Purge Deleted Key operation is applicable for soft-delete enabled + * vaults. While the operation can be invoked on any vault, it will return an + * error if invoked on a non soft-delete enabled vault. This operation requires + * the keys/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + purgeDeletedKey(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + purgeDeletedKey(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + purgeDeletedKey(vaultBaseUrl: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers the deleted key to its latest version. + * + * The Recover Deleted Key operation is applicable for deleted keys in + * soft-delete enabled vaults. It recovers the deleted key back to its latest + * version under /keys. An attempt to recover an non-deleted key will return an + * error. Consider this the inverse of the delete operation on soft-delete + * enabled vaults. This operation requires the keys/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the deleted key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + recoverDeletedKeyWithHttpOperationResponse(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers the deleted key to its latest version. + * + * The Recover Deleted Key operation is applicable for deleted keys in + * soft-delete enabled vaults. It recovers the deleted key back to its latest + * version under /keys. An attempt to recover an non-deleted key will return an + * error. Consider this the inverse of the delete operation on soft-delete + * enabled vaults. This operation requires the keys/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the deleted key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyBundle} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedKey(vaultBaseUrl: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverDeletedKey(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + recoverDeletedKey(vaultBaseUrl: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Sets a secret in a specified key vault. + * + * The SET operation adds a secret to the Azure Key Vault. If the named secret + * already exists, Azure Key Vault creates a new version of that secret. This + * operation requires the secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} value The value of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + setSecretWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, value: string, options?: { tags? : { [propertyName: string]: string }, contentType? : string, secretAttributes? : models.SecretAttributes, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Sets a secret in a specified key vault. + * + * The SET operation adds a secret to the Azure Key Vault. If the named secret + * already exists, Azure Key Vault creates a new version of that secret. This + * operation requires the secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} value The value of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + setSecret(vaultBaseUrl: string, secretName: string, value: string, options?: { tags? : { [propertyName: string]: string }, contentType? : string, secretAttributes? : models.SecretAttributes, customHeaders? : { [headerName: string]: string; } }): Promise; + setSecret(vaultBaseUrl: string, secretName: string, value: string, callback: ServiceCallback): void; + setSecret(vaultBaseUrl: string, secretName: string, value: string, options: { tags? : { [propertyName: string]: string }, contentType? : string, secretAttributes? : models.SecretAttributes, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a secret from a specified key vault. + * + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE + * cannot be applied to an individual version of a secret. This operation + * requires the secrets/delete permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteSecretWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a secret from a specified key vault. + * + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE + * cannot be applied to an individual version of a secret. This operation + * requires the secrets/delete permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedSecretBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSecretBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSecret(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSecret(vaultBaseUrl: string, secretName: string, callback: ServiceCallback): void; + deleteSecret(vaultBaseUrl: string, secretName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the attributes associated with a specified secret in a + * given key vault. + * + * The UPDATE operation changes specified attributes of an existing stored + * secret. Attributes that are not specified in the request are left unchanged. + * The value of a secret itself cannot be changed. This operation requires the + * secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateSecretWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, secretVersion: string, options?: { contentType? : string, secretAttributes? : models.SecretAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the attributes associated with a specified secret in a + * given key vault. + * + * The UPDATE operation changes specified attributes of an existing stored + * secret. Attributes that are not specified in the request are left unchanged. + * The value of a secret itself cannot be changed. This operation requires the + * secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, options?: { contentType? : string, secretAttributes? : models.SecretAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + updateSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, callback: ServiceCallback): void; + updateSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, options: { contentType? : string, secretAttributes? : models.SecretAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a specified secret from a given key vault. + * + * The GET operation is applicable to any secret stored in Azure Key Vault. + * This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSecretWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, secretVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a specified secret from a given key vault. + * + * The GET operation is applicable to any secret stored in Azure Key Vault. + * This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, callback: ServiceCallback): void; + getSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSecretsWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSecrets(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getSecrets(vaultBaseUrl: string, callback: ServiceCallback): void; + getSecrets(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSecretVersionsWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSecretVersions(vaultBaseUrl: string, secretName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getSecretVersions(vaultBaseUrl: string, secretName: string, callback: ServiceCallback): void; + getSecretVersions(vaultBaseUrl: string, secretName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedSecretsWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedSecretListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSecretListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSecrets(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSecrets(vaultBaseUrl: string, callback: ServiceCallback): void; + getDeletedSecrets(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the specified deleted secret. + * + * The Get Deleted Secret operation returns the specified deleted secret along + * with its attributes. This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedSecretWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the specified deleted secret. + * + * The Get Deleted Secret operation returns the specified deleted secret along + * with its attributes. This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedSecretBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSecretBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSecret(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSecret(vaultBaseUrl: string, secretName: string, callback: ServiceCallback): void; + getDeletedSecret(vaultBaseUrl: string, secretName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Permanently deletes the specified secret. + * + * The purge deleted secret operation removes the secret permanently, without + * the possibility of recovery. This operation can only be enabled on a + * soft-delete enabled vault. This operation requires the secrets/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + purgeDeletedSecretWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Permanently deletes the specified secret. + * + * The purge deleted secret operation removes the secret permanently, without + * the possibility of recovery. This operation can only be enabled on a + * soft-delete enabled vault. This operation requires the secrets/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + purgeDeletedSecret(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + purgeDeletedSecret(vaultBaseUrl: string, secretName: string, callback: ServiceCallback): void; + purgeDeletedSecret(vaultBaseUrl: string, secretName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers the deleted secret to the latest version. + * + * Recovers the deleted secret in the specified vault. This operation can only + * be performed on a soft-delete enabled vault. This operation requires the + * secrets/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the deleted secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + recoverDeletedSecretWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers the deleted secret to the latest version. + * + * Recovers the deleted secret in the specified vault. This operation can only + * be performed on a soft-delete enabled vault. This operation requires the + * secrets/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the deleted secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedSecret(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverDeletedSecret(vaultBaseUrl: string, secretName: string, callback: ServiceCallback): void; + recoverDeletedSecret(vaultBaseUrl: string, secretName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Backs up the specified secret. + * + * Requests that a backup of the specified secret be downloaded to the client. + * All versions of the secret will be downloaded. This operation requires the + * secrets/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + backupSecretWithHttpOperationResponse(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Backs up the specified secret. + * + * Requests that a backup of the specified secret be downloaded to the client. + * All versions of the secret will be downloaded. This operation requires the + * secrets/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BackupSecretResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackupSecretResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackupSecretResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + backupSecret(vaultBaseUrl: string, secretName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backupSecret(vaultBaseUrl: string, secretName: string, callback: ServiceCallback): void; + backupSecret(vaultBaseUrl: string, secretName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a backed up secret to a vault. + * + * Restores a backed up secret, and all its versions, to a vault. This + * operation requires the secrets/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} secretBundleBackup The backup blob associated with a secret + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + restoreSecretWithHttpOperationResponse(vaultBaseUrl: string, secretBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a backed up secret to a vault. + * + * Restores a backed up secret, and all its versions, to a vault. This + * operation requires the secrets/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} secretBundleBackup The backup blob associated with a secret + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + restoreSecret(vaultBaseUrl: string, secretBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreSecret(vaultBaseUrl: string, secretBundleBackup: Buffer, callback: ServiceCallback): void; + restoreSecret(vaultBaseUrl: string, secretBundleBackup: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificatesWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateListResult} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificates(vaultBaseUrl: string, options?: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificates(vaultBaseUrl: string, callback: ServiceCallback): void; + getCertificates(vaultBaseUrl: string, options: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a certificate from a specified key vault. + * + * Deletes all versions of a certificate object along with its associated + * policy. Delete certificate cannot be used to remove individual versions of a + * certificate object. This operation requires the certificates/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a certificate from a specified key vault. + * + * Deletes all versions of a certificate object along with its associated + * policy. Delete certificate cannot be used to remove individual versions of a + * certificate object. This operation requires the certificates/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {DeletedCertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedCertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateBundle} for more + * information. + * + * {WebResource} [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(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + deleteCertificate(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Sets the certificate contacts for the specified key vault. + * + * Sets the certificate contacts for the specified key vault. This operation + * requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} contacts The contacts for the key vault certificate. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + setCertificateContactsWithHttpOperationResponse(vaultBaseUrl: string, contacts: models.Contacts, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Sets the certificate contacts for the specified key vault. + * + * Sets the certificate contacts for the specified key vault. This operation + * requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} contacts The contacts for the key vault certificate. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Contacts} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Contacts} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + setCertificateContacts(vaultBaseUrl: string, contacts: models.Contacts, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + setCertificateContacts(vaultBaseUrl: string, contacts: models.Contacts, callback: ServiceCallback): void; + setCertificateContacts(vaultBaseUrl: string, contacts: models.Contacts, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists the certificate contacts for a specified key vault. + * + * The GetCertificateContacts operation returns the set of certificate contact + * resources in the specified key vault. This operation requires the + * certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificateContactsWithHttpOperationResponse(vaultBaseUrl: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists the certificate contacts for a specified key vault. + * + * The GetCertificateContacts operation returns the set of certificate contact + * resources in the specified key vault. This operation requires the + * certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Contacts} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Contacts} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateContacts(vaultBaseUrl: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificateContacts(vaultBaseUrl: string, callback: ServiceCallback): void; + getCertificateContacts(vaultBaseUrl: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the certificate contacts for a specified key vault. + * + * Deletes the certificate contacts for a specified key vault certificate. This + * operation requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteCertificateContactsWithHttpOperationResponse(vaultBaseUrl: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the certificate contacts for a specified key vault. + * + * Deletes the certificate contacts for a specified key vault certificate. This + * operation requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Contacts} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Contacts} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteCertificateContacts(vaultBaseUrl: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteCertificateContacts(vaultBaseUrl: string, callback: ServiceCallback): void; + deleteCertificateContacts(vaultBaseUrl: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificateIssuersWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateIssuerListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateIssuerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateIssuers(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificateIssuers(vaultBaseUrl: string, callback: ServiceCallback): void; + getCertificateIssuers(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Sets the specified certificate issuer. + * + * The SetCertificateIssuer operation adds or updates the specified certificate + * issuer. This operation requires the certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {string} provider The issuer provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + setCertificateIssuerWithHttpOperationResponse(vaultBaseUrl: string, issuerName: string, provider: string, options?: { credentials? : models.IssuerCredentials, organizationDetails? : models.OrganizationDetails, attributes? : models.IssuerAttributes, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Sets the specified certificate issuer. + * + * The SetCertificateIssuer operation adds or updates the specified certificate + * issuer. This operation requires the certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {string} provider The issuer provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IssuerBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IssuerBundle} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + setCertificateIssuer(vaultBaseUrl: string, issuerName: string, provider: string, options?: { credentials? : models.IssuerCredentials, organizationDetails? : models.OrganizationDetails, attributes? : models.IssuerAttributes, customHeaders? : { [headerName: string]: string; } }): Promise; + setCertificateIssuer(vaultBaseUrl: string, issuerName: string, provider: string, callback: ServiceCallback): void; + setCertificateIssuer(vaultBaseUrl: string, issuerName: string, provider: string, options: { credentials? : models.IssuerCredentials, organizationDetails? : models.OrganizationDetails, attributes? : models.IssuerAttributes, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the specified certificate issuer. + * + * The UpdateCertificateIssuer operation performs an update on the specified + * certificate issuer entity. This operation requires the + * certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.provider] The issuer provider. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateCertificateIssuerWithHttpOperationResponse(vaultBaseUrl: string, issuerName: string, options?: { provider? : string, credentials? : models.IssuerCredentials, organizationDetails? : models.OrganizationDetails, attributes? : models.IssuerAttributes, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the specified certificate issuer. + * + * The UpdateCertificateIssuer operation performs an update on the specified + * certificate issuer entity. This operation requires the + * certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.provider] The issuer provider. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IssuerBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IssuerBundle} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: { provider? : string, credentials? : models.IssuerCredentials, organizationDetails? : models.OrganizationDetails, attributes? : models.IssuerAttributes, customHeaders? : { [headerName: string]: string; } }): Promise; + updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, callback: ServiceCallback): void; + updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, options: { provider? : string, credentials? : models.IssuerCredentials, organizationDetails? : models.OrganizationDetails, attributes? : models.IssuerAttributes, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists the specified certificate issuer. + * + * The GetCertificateIssuer operation returns the specified certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificateIssuerWithHttpOperationResponse(vaultBaseUrl: string, issuerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists the specified certificate issuer. + * + * The GetCertificateIssuer operation returns the specified certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IssuerBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IssuerBundle} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificateIssuer(vaultBaseUrl: string, issuerName: string, callback: ServiceCallback): void; + getCertificateIssuer(vaultBaseUrl: string, issuerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the specified certificate issuer. + * + * The DeleteCertificateIssuer operation permanently removes the specified + * certificate issuer from the vault. This operation requires the + * certificates/manageissuers/deleteissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteCertificateIssuerWithHttpOperationResponse(vaultBaseUrl: string, issuerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the specified certificate issuer. + * + * The DeleteCertificateIssuer operation permanently removes the specified + * certificate issuer from the vault. This operation requires the + * certificates/manageissuers/deleteissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IssuerBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IssuerBundle} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, callback: ServiceCallback): void; + deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new certificate. + * + * If this is the first version, the certificate resource is created. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new certificate. + * + * If this is the first version, the certificate resource is created. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateOperation} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateOperation} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createCertificate(vaultBaseUrl: string, certificateName: string, options?: { certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + createCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + createCertificate(vaultBaseUrl: string, certificateName: string, options: { certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Imports a certificate into a specified key vault. + * + * Imports an existing valid certificate, containing a private key, into Azure + * Key Vault. The certificate to be imported can be in either PFX or PEM + * format. If the certificate is in PEM format the PEM file must contain the + * key as well as x509 certificates. This operation requires the + * certificates/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + importCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, options?: { password? : string, certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Imports a certificate into a specified key vault. + * + * Imports an existing valid certificate, containing a private key, into Azure + * Key Vault. The certificate to be imported can be in either PFX or PEM + * format. If the certificate is in PEM format the PEM file must contain the + * key as well as x509 certificates. This operation requires the + * certificates/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, options?: { password? : string, certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, callback: ServiceCallback): void; + importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, options: { password? : string, certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificateVersionsWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateListResult} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateVersions(vaultBaseUrl: string, certificateName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificateVersions(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + getCertificateVersions(vaultBaseUrl: string, certificateName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists the policy for a certificate. + * + * The GetCertificatePolicy operation returns the specified certificate policy + * resources in the specified key vault. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in a given key + * vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificatePolicyWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists the policy for a certificate. + * + * The GetCertificatePolicy operation returns the specified certificate policy + * resources in the specified key vault. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in a given key + * vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificatePolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificatePolicy} [result] - The deserialized result object if an error did not occur. + * See {@link CertificatePolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificatePolicy(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificatePolicy(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + getCertificatePolicy(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the policy for a certificate. + * + * Set specified members in the certificate policy. Leave others as null. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the + * same key pair will be used on certificate renewal. + * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. + * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC. + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateCertificatePolicyWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, certificatePolicy: models.CertificatePolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the policy for a certificate. + * + * Set specified members in the certificate policy. Leave others as null. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the + * same key pair will be used on certificate renewal. + * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. + * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC. + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificatePolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificatePolicy} [result] - The deserialized result object if an error did not occur. + * See {@link CertificatePolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: models.CertificatePolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: models.CertificatePolicy, callback: ServiceCallback): void; + updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: models.CertificatePolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the specified attributes associated with the given + * certificate. + * + * The UpdateCertificate operation applies the specified update on the given + * certificate; the only elements updated are the certificate's attributes. + * This operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given key + * vault. + * + * @param {string} certificateVersion The version of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that 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(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options?: { certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the specified attributes associated with the given + * certificate. + * + * The UpdateCertificate operation applies the specified update on the given + * certificate; the only elements updated are the certificate's attributes. + * This operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given key + * vault. + * + * @param {string} certificateVersion The version of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {WebResource} [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(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options?: { certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + updateCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, callback: ServiceCallback): void; + updateCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options: { certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets information about a certificate. + * + * Gets information about a specific certificate. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {string} certificateVersion The version 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(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets information about a certificate. + * + * Gets information about a specific certificate. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {string} certificateVersion The version 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 {CertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {WebResource} [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(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, callback: ServiceCallback): void; + getCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a certificate operation. + * + * Updates a certificate creation operation that is already in progress. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateCertificateOperationWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, cancellationRequested: boolean, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates a certificate operation. + * + * Updates a certificate creation operation that is already in progress. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate 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 {CertificateOperation} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateOperation} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateCertificateOperation(vaultBaseUrl: string, certificateName: string, cancellationRequested: boolean, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateCertificateOperation(vaultBaseUrl: string, certificateName: string, cancellationRequested: boolean, callback: ServiceCallback): void; + updateCertificateOperation(vaultBaseUrl: string, certificateName: string, cancellationRequested: boolean, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the creation operation of a certificate. + * + * Gets the creation operation associated with a specified certificate. This + * operation requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + getCertificateOperationWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the creation operation of a certificate. + * + * Gets the creation operation associated with a specified certificate. This + * operation requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {CertificateOperation} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateOperation} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateOperation(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificateOperation(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + getCertificateOperation(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the creation operation for a specific certificate. + * + * Deletes the creation operation for a specified certificate that is in the + * process of being created. The certificate is no longer created. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + deleteCertificateOperationWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the creation operation for a specific certificate. + * + * Deletes the creation operation for a specified certificate that is in the + * process of being created. The certificate is no longer created. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {CertificateOperation} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateOperation} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Merges a certificate or a certificate chain with a key pair + * existing on the server. + * + * The MergeCertificate operation performs the merging of a certificate or + * certificate chain with a key pair currently available in the service. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + mergeCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, x509Certificates: Buffer[], options?: { certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Merges a certificate or a certificate chain with a key pair + * existing on the server. + * + * The MergeCertificate operation performs the merging of a certificate or + * certificate chain with a key pair currently available in the service. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Buffer[], options?: { certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Buffer[], callback: ServiceCallback): void; + mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Buffer[], options: { certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Backs up the specified certificate. + * + * Requests that a backup of the specified certificate be downloaded to the + * client. All versions of the certificate will be downloaded. This operation + * requires the certificates/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + backupCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Backs up the specified certificate. + * + * Requests that a backup of the specified certificate be downloaded to the + * client. All versions of the certificate will be downloaded. This operation + * requires the certificates/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {BackupCertificateResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackupCertificateResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackupCertificateResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + backupCertificate(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backupCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + backupCertificate(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a backed up certificate to a vault. + * + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + restoreCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a backed up certificate to a vault. + * + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Buffer, callback: ServiceCallback): void; + restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedCertificatesWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedCertificateListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedCertificateListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedCertificates(vaultBaseUrl: string, options?: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedCertificates(vaultBaseUrl: string, callback: ServiceCallback): void; + getDeletedCertificates(vaultBaseUrl: string, options: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves information about the specified deleted certificate. + * + * The GetDeletedCertificate operation retrieves the deleted certificate + * information plus its attributes, such as retention interval, scheduled + * permanent deletion and the current deletion recovery level. This operation + * requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + getDeletedCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves information about the specified deleted certificate. + * + * The GetDeletedCertificate operation retrieves the deleted certificate + * information plus its attributes, such as retention interval, scheduled + * permanent deletion and the current deletion recovery level. This operation + * requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {DeletedCertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedCertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateBundle} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + getDeletedCertificate(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Permanently deletes the specified deleted certificate. + * + * The PurgeDeletedCertificate operation performs an irreversible deletion of + * the specified certificate, without possibility for recovery. The operation + * is not available if the recovery level does not specify 'Purgeable'. This + * operation requires the certificate/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + purgeDeletedCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Permanently deletes the specified deleted certificate. + * + * The PurgeDeletedCertificate operation performs an irreversible deletion of + * the specified certificate, without possibility for recovery. The operation + * is not available if the recovery level does not specify 'Purgeable'. This + * operation requires the certificate/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + purgeDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + purgeDeletedCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + purgeDeletedCertificate(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers the deleted certificate back to its current version under + * /certificates. + * + * The RecoverDeletedCertificate operation performs the reversal of the Delete + * operation. The operation is applicable in vaults enabled for soft-delete, + * and must be issued during the retention interval (available in the deleted + * certificate's attributes). This operation requires the certificates/recover + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the deleted 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. + */ + recoverDeletedCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers the deleted certificate back to its current version under + * /certificates. + * + * The RecoverDeletedCertificate operation performs the reversal of the Delete + * operation. The operation is applicable in vaults enabled for soft-delete, + * and must be issued during the retention interval (available in the deleted + * certificate's attributes). This operation requires the certificates/recover + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the deleted 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 {CertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverDeletedCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + recoverDeletedCertificate(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getStorageAccountsWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link StorageListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getStorageAccounts(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getStorageAccounts(vaultBaseUrl: string, callback: ServiceCallback): void; + getStorageAccounts(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedStorageAccountsWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedStorageListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedStorageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedStorageAccounts(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedStorageAccounts(vaultBaseUrl: string, callback: ServiceCallback): void; + getDeletedStorageAccounts(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the specified deleted storage account. + * + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the specified deleted storage account. + * + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedStorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedStorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + getDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Permanently deletes the specified storage account. + * + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + purgeDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Permanently deletes the specified storage account. + * + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + purgeDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + purgeDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + purgeDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers the deleted storage account. + * + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + recoverDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers the deleted storage account. + * + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + recoverDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Backs up the specified storage account. + * + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + backupStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Backs up the specified storage account. + * + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BackupStorageResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackupStorageResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackupStorageResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + backupStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backupStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + backupStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a backed up storage account to a vault. + * + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + restoreStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a backed up storage account to a vault. + * + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + restoreStorageAccount(vaultBaseUrl: string, storageBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreStorageAccount(vaultBaseUrl: string, storageBundleBackup: Buffer, callback: ServiceCallback): void; + restoreStorageAccount(vaultBaseUrl: string, storageBundleBackup: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a storage account. This operation requires the storage/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a storage account. This operation requires the storage/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedStorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedStorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about a specified storage account. This operation requires + * the storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about a specified storage account. This operation requires + * the storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + getStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a new storage account. This operation requires the + * storage/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + setStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options?: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a new storage account. This operation requires the + * storage/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options?: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, callback: ServiceCallback): void; + setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} keyName The storage account key 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. + */ + regenerateStorageAccountKeyWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} keyName The storage account key 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 {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, callback: ServiceCallback): void; + regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSasDefinitionsWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SasDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SasDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedSasDefinitionsWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedSasDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSasDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSasDefinitions(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + getDeletedSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedSasDefinitionBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionBundle} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; + getDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + recoverDeletedSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SasDefinitionBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; + recoverDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a SAS definition from a specified storage account. This operation + * requires the storage/deletesas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a SAS definition from a specified storage account. This operation + * requires the storage/deletesas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedSasDefinitionBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionBundle} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; + deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about a SAS definition for the specified storage account. + * This operation requires the storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about a SAS definition for the specified storage account. + * This operation requires the storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SasDefinitionBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; + getSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a new SAS definition for the specified storage account. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + setSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, templateUri: string, sasType: string, validityPeriod: string, options?: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a new SAS definition for the specified storage account. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SasDefinitionBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, templateUri: string, sasType: string, validityPeriod: string, options?: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, templateUri: string, sasType: string, validityPeriod: string, callback: ServiceCallback): void; + setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, templateUri: string, sasType: string, validityPeriod: string, options: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified attributes associated with the given SAS definition. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { templateUri? : string, sasType? : string, validityPeriod? : string, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified attributes associated with the given SAS definition. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SasDefinitionBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { templateUri? : string, sasType? : string, validityPeriod? : string, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + updateSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; + updateSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { templateUri? : string, sasType? : string, validityPeriod? : string, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getKeyVersionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the 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 {KeyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getKeyVersionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getKeyVersionsNext(nextPageLink: string, callback: ServiceCallback): void; + getKeyVersionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getKeysNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} nextPageLink The NextLink from the 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 {KeyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {KeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getKeysNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getKeysNext(nextPageLink: string, callback: ServiceCallback): void; + getKeysNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedKeysNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the 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 {DeletedKeyListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedKeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedKeysNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedKeysNext(nextPageLink: string, callback: ServiceCallback): void; + getDeletedKeysNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSecretsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the 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 {SecretListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSecretsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSecretsNext(nextPageLink: string, callback: ServiceCallback): void; + getSecretsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSecretVersionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the 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 {SecretListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecretListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSecretVersionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSecretVersionsNext(nextPageLink: string, callback: ServiceCallback): void; + getSecretVersionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedSecretsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the 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 {DeletedSecretListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSecretListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSecretsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSecretsNext(nextPageLink: string, callback: ServiceCallback): void; + getDeletedSecretsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificatesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the 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 {CertificateListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateListResult} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificatesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificatesNext(nextPageLink: string, callback: ServiceCallback): void; + getCertificatesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificateIssuersNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} nextPageLink The NextLink from the 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 {CertificateIssuerListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateIssuerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateIssuersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificateIssuersNext(nextPageLink: string, callback: ServiceCallback): void; + getCertificateIssuersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getCertificateVersionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the 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 {CertificateListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateListResult} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateVersionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificateVersionsNext(nextPageLink: string, callback: ServiceCallback): void; + getCertificateVersionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedCertificatesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} nextPageLink The NextLink from the 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 {DeletedCertificateListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedCertificateListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedCertificatesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedCertificatesNext(nextPageLink: string, callback: ServiceCallback): void; + getDeletedCertificatesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getStorageAccountsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the 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 {StorageListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link StorageListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getStorageAccountsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getStorageAccountsNext(nextPageLink: string, callback: ServiceCallback): void; + getStorageAccountsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedStorageAccountsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the 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 {DeletedStorageListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedStorageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedStorageAccountsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedStorageAccountsNext(nextPageLink: string, callback: ServiceCallback): void; + getDeletedStorageAccountsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSasDefinitionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the 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 {SasDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SasDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSasDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSasDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; + getSasDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedSasDefinitionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the 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 {DeletedSasDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSasDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSasDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; + getDeletedSasDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +export { KeyVaultClient, models as KeyVaultModels }; diff --git a/lib/services/keyvault/lib/keyVaultClient.js b/lib/services/keyvault/lib/keyVaultClient.js new file mode 100644 index 0000000000..3ba70c3b2c --- /dev/null +++ b/lib/services/keyvault/lib/keyVaultClient.js @@ -0,0 +1,25998 @@ +/* + * 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'); + + +/** + * @summary Creates a new key, stores it, then returns key parameters and + * attributes to the client. + * + * The create key operation can be used to create any key type in Azure Key + * Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. It requires the keys/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name for the new key. The system will generate + * the version name for the new key. + * + * @param {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bits. For example: 2048, + * 3072, or 4096 for RSA. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createKey(vaultBaseUrl, keyName, kty, 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 keySize = (options && options.keySize !== undefined) ? options.keySize : undefined; + let keyOps = (options && options.keyOps !== undefined) ? options.keyOps : undefined; + let keyAttributes = (options && options.keyAttributes !== undefined) ? options.keyAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + let curve = (options && options.curve !== undefined) ? options.curve : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyName !== null && keyName !== undefined) { + if (keyName.match(/^[0-9a-zA-Z-]+$/) === null) + { + throw new Error('"keyName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z-]+$/'); + } + } + 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 (kty === null || kty === undefined || typeof kty.valueOf() !== 'string') { + throw new Error('kty cannot be null or undefined and it must be of type string.'); + } + if (kty !== null && kty !== undefined) { + if (kty.length < 1) + { + throw new Error('"kty" should satisfy the constraint - "MinLength": 1'); + } + } + if (keySize !== null && keySize !== undefined && typeof keySize !== 'number') { + throw new Error('keySize must be of type number.'); + } + if (Array.isArray(keyOps)) { + for (let i = 0; i < keyOps.length; i++) { + if (keyOps[i] !== null && keyOps[i] !== undefined && typeof keyOps[i].valueOf() !== 'string') { + throw new Error('keyOps[i] must be of type string.'); + } + } + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (curve !== null && curve !== undefined && typeof curve.valueOf() !== 'string') { + throw new Error('curve 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 parameters; + if ((kty !== null && kty !== undefined) || (keySize !== null && keySize !== undefined) || (keyOps !== null && keyOps !== undefined) || (keyAttributes !== null && keyAttributes !== undefined) || (tags !== null && tags !== undefined) || (curve !== null && curve !== undefined)) { + parameters = new client.models['KeyCreateParameters'](); + parameters.kty = kty; + parameters.keySize = keySize; + parameters.keyOps = keyOps; + parameters.keyAttributes = keyAttributes; + parameters.tags = tags; + parameters.curve = curve; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}/create'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + 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['KeyCreateParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Imports an externally created key, stores it, and returns key + * parameters and attributes to the client. + * + * The import key operation may be used to import any key type into an Azure + * Key Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. This operation requires the keys/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName Name for the imported key. + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key identifier. + * + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus. + * + * @param {buffer} [key.e] RSA public exponent. + * + * @param {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * + * @param {buffer} [key.dp] RSA private key parameter. + * + * @param {buffer} [key.dq] RSA private key parameter. + * + * @param {buffer} [key.qi] RSA private key parameter. + * + * @param {buffer} [key.p] RSA secret prime. + * + * @param {buffer} [key.q] RSA secret prime, with p < q. + * + * @param {buffer} [key.k] Symmetric key. + * + * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * + * @param {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {buffer} [key.x] X component of an EC public key. + * + * @param {buffer} [key.y] Y component of an EC public key. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key. + * + * @param {object} [options.keyAttributes] The key management attributes. + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _importKey(vaultBaseUrl, keyName, key, 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 hsm = (options && options.hsm !== undefined) ? options.hsm : undefined; + let keyAttributes = (options && options.keyAttributes !== undefined) ? options.keyAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyName !== null && keyName !== undefined) { + if (keyName.match(/^[0-9a-zA-Z-]+$/) === null) + { + throw new Error('"keyName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z-]+$/'); + } + } + 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 (hsm !== null && hsm !== undefined && typeof hsm !== 'boolean') { + throw new Error('hsm must be of type boolean.'); + } + if (key === null || key === undefined) { + throw new Error('key cannot be null or undefined.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((hsm !== null && hsm !== undefined) || (key !== null && key !== undefined) || (keyAttributes !== null && keyAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['KeyImportParameters'](); + parameters.hsm = hsm; + parameters.key = key; + parameters.keyAttributes = keyAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['KeyImportParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 key of any type from storage in Azure Key Vault. + * + * The delete key operation cannot be used to remove individual versions of a + * key. This operation removes the cryptographic material associated with the + * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or + * Encrypt/Decrypt operations. This operation requires the keys/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteKey(vaultBaseUrl, keyName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName 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('/') ? '' : '/') + 'keys/{key-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + 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 = 'DELETE'; + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedKeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary The update key operation changes specified attributes of a stored + * key and can be applied to any key type and key version stored in Azure Key + * Vault. + * + * In order to perform this operation, the key must already exist in the Key + * Vault. Note: The cryptographic material of a key itself cannot be changed. + * This operation requires the keys/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of key to update. + * + * @param {string} keyVersion The version of the key to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateKey(vaultBaseUrl, keyName, keyVersion, 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 keyOps = (options && options.keyOps !== undefined) ? options.keyOps : undefined; + let keyAttributes = (options && options.keyAttributes !== undefined) ? options.keyAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion 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 (Array.isArray(keyOps)) { + for (let i = 0; i < keyOps.length; i++) { + if (keyOps[i] !== null && keyOps[i] !== undefined && typeof keyOps[i].valueOf() !== 'string') { + throw new Error('keyOps[i] must be of type string.'); + } + } + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((keyOps !== null && keyOps !== undefined) || (keyAttributes !== null && keyAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['KeyUpdateParameters'](); + parameters.keyOps = keyOps; + parameters.keyAttributes = keyAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}/{key-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + 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 = 'PATCH'; + 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['KeyUpdateParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 public part of a stored key. + * + * The get key operation is applicable to all key types. If the requested key + * is symmetric, then no key material is released in the response. This + * operation requires the keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to get. + * + * @param {string} keyVersion Adding the version parameter retrieves a specific + * version of a key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getKey(vaultBaseUrl, keyName, keyVersion, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion 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('/') ? '' : '/') + 'keys/{key-name}/{key-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getKeyVersions(vaultBaseUrl, keyName, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'keys/{key-name}/versions'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getKeys(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'keys'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Requests that a backup of the specified key be downloaded to the + * client. + * + * The Key Backup operation exports a key from Azure Key Vault in a protected + * form. Note that this operation does NOT return key material in a form that + * can be used outside the Azure Key Vault system, the returned key material is + * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The + * intent of this operation is to allow a client to GENERATE a key in one Azure + * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure + * Key Vault instance. The BACKUP operation may be used to export, in protected + * form, any key type from Azure Key Vault. Individual versions of a key cannot + * be backed up. BACKUP / RESTORE can be performed within geographical + * boundaries only; meaning that a BACKUP from one geographical area cannot be + * restored to another geographical area. For example, a backup from the US + * geographical area cannot be restored in an EU geographical area. This + * operation requires the key/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupKeyResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _backupKey(vaultBaseUrl, keyName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName 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('/') ? '' : '/') + 'keys/{key-name}/backup'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackupKeyResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 backed up key to a vault. + * + * Imports a previously backed up key into Azure Key Vault, restoring the key, + * its key identifier, attributes and access control policies. The RESTORE + * operation may be used to import a previously backed up key. Individual + * versions of a key cannot be restored. The key is restored in its entirety + * with the same key name as it had when it was backed up. If the key name is + * not available in the target Key Vault, the RESTORE operation will be + * rejected. While the key name is retained during restore, the final key + * identifier will change if the key is restored to a different vault. Restore + * will restore all versions and preserve version identifiers. The RESTORE + * operation is subject to security constraints: The target Key Vault must be + * owned by the same Microsoft Azure Subscription as the source Key Vault The + * user must have RESTORE permission in the target Key Vault. This operation + * requires the keys/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} keyBundleBackup The backup blob associated with a key + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreKey(vaultBaseUrl, keyBundleBackup, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl 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 (!Buffer.isBuffer(keyBundleBackup)) { + throw new Error('keyBundleBackup cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if (keyBundleBackup !== null && keyBundleBackup !== undefined) { + parameters = new client.models['KeyRestoreParameters'](); + parameters.keyBundleBackup = keyBundleBackup; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/restore'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + 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['KeyRestoreParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Encrypts an arbitrary sequence of bytes using an encryption key + * that is stored in a key vault. + * + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an + * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT + * operation only supports a single block of data, the size of which is + * dependent on the target key and the encryption algorithm to be used. The + * ENCRYPT operation is only strictly necessary for symmetric keys stored in + * Azure Key Vault since protection with an asymmetric key can be performed + * using public portion of the key. This operation is supported for asymmetric + * keys as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/encypt + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion 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 (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeyOperationsParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}/{key-version}/encrypt'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + 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['KeyOperationsParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Decrypts a single block of encrypted data. + * + * The DECRYPT operation decrypts a well-formed block of ciphertext using the + * target encryption key and specified algorithm. This operation is the reverse + * of the ENCRYPT operation; only a single block of data may be decrypted, the + * size of this block is dependent on the target key and the algorithm to be + * used. The DECRYPT operation applies to asymmetric and symmetric keys stored + * in Azure Key Vault since it uses the private portion of the key. This + * operation requires the keys/decrypt permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion 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 (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeyOperationsParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}/{key-version}/decrypt'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + 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['KeyOperationsParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 signature from a digest using the specified key. + * + * The SIGN operation is applicable to asymmetric and symmetric keys stored in + * Azure Key Vault since this operation uses the private portion of the key. + * This operation requires the keys/sign permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm identifier. For + * more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion 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 (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeySignParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}/{key-version}/sign'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + 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['KeySignParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 a signature using a specified key. + * + * The VERIFY operation is applicable to symmetric keys stored in Azure Key + * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure + * Key Vault since signature verification can be performed using the public + * portion of the key but this operation is supported as a convenience for + * callers that only have a key-reference and not the public portion of the + * key. This operation requires the keys/verify permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * + * @param {buffer} digest The digest used for signing. + * + * @param {buffer} signature The signature to be verified. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyVerifyResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion 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 (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(digest)) { + throw new Error('digest cannot be null or undefined and it must be of type buffer.'); + } + if (!Buffer.isBuffer(signature)) { + throw new Error('signature cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if ((algorithm !== null && algorithm !== undefined) || (digest !== null && digest !== undefined) || (signature !== null && signature !== undefined)) { + parameters = new client.models['KeyVerifyParameters'](); + parameters.algorithm = algorithm; + parameters.digest = digest; + parameters.signature = signature; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}/{key-version}/verify'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + 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['KeyVerifyParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyVerifyResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Wraps a symmetric key using a specified key. + * + * The WRAP operation supports encryption of a symmetric key using a key + * encryption key that has previously been stored in an Azure Key Vault. The + * WRAP operation is only strictly necessary for symmetric keys stored in Azure + * Key Vault since protection with an asymmetric key can be performed using the + * public portion of the key. This operation is supported for asymmetric keys + * as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/wrapKey + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion 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 (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeyOperationsParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}/{key-version}/wrapkey'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + 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['KeyOperationsParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Unwraps a symmetric key using the specified key that was initially + * used for wrapping that key. + * + * The UNWRAP operation supports decryption of a symmetric key using the target + * key encryption key. This operation is the reverse of the WRAP operation. The + * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure + * Key Vault since it uses the private portion of the key. This operation + * requires the keys/unwrapKey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion 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 (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeyOperationsParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'keys/{key-name}/{key-version}/unwrapkey'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + 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['KeyOperationsParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedKeys(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'deletedkeys'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedKeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 public part of a deleted key. + * + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. + * While the operation can be invoked on any vault, it will return an error if + * invoked on a non soft-delete enabled vault. This operation requires the + * keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedKey(vaultBaseUrl, keyName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName 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('/') ? '' : '/') + 'deletedkeys/{key-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedKeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Permanently deletes the specified key. + * + * The Purge Deleted Key operation is applicable for soft-delete enabled + * vaults. While the operation can be invoked on any vault, it will return an + * error if invoked on a non soft-delete enabled vault. This operation requires + * the keys/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _purgeDeletedKey(vaultBaseUrl, keyName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName 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('/') ? '' : '/') + 'deletedkeys/{key-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + 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 = 'DELETE'; + 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 !== 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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 Recovers the deleted key to its latest version. + * + * The Recover Deleted Key operation is applicable for deleted keys in + * soft-delete enabled vaults. It recovers the deleted key back to its latest + * version under /keys. An attempt to recover an non-deleted key will return an + * error. Consider this the inverse of the delete operation on soft-delete + * enabled vaults. This operation requires the keys/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the deleted key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _recoverDeletedKey(vaultBaseUrl, keyName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName 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('/') ? '' : '/') + 'deletedkeys/{key-name}/recover'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 a secret in a specified key vault. + * + * The SET operation adds a secret to the Azure Key Vault. If the named secret + * already exists, Azure Key Vault creates a new version of that secret. This + * operation requires the secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} value The value of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _setSecret(vaultBaseUrl, secretName, value, 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 tags = (options && options.tags !== undefined) ? options.tags : undefined; + let contentType = (options && options.contentType !== undefined) ? options.contentType : undefined; + let secretAttributes = (options && options.secretAttributes !== undefined) ? options.secretAttributes : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (secretName !== null && secretName !== undefined) { + if (secretName.match(/^[0-9a-zA-Z-]+$/) === null) + { + throw new Error('"secretName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z-]+$/'); + } + } + 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 (value === null || value === undefined || typeof value.valueOf() !== 'string') { + throw new Error('value cannot be null or undefined and it must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (contentType !== null && contentType !== undefined && typeof contentType.valueOf() !== 'string') { + throw new Error('contentType 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 parameters; + if ((value !== null && value !== undefined) || (tags !== null && tags !== undefined) || (contentType !== null && contentType !== undefined) || (secretAttributes !== null && secretAttributes !== undefined)) { + parameters = new client.models['SecretSetParameters'](); + parameters.value = value; + parameters.tags = tags; + parameters.contentType = contentType; + parameters.secretAttributes = secretAttributes; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'secrets/{secret-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['SecretSetParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 secret from a specified key vault. + * + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE + * cannot be applied to an individual version of a secret. This operation + * requires the secrets/delete permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSecret(vaultBaseUrl, secretName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName 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('/') ? '' : '/') + 'secrets/{secret-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + 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 = 'DELETE'; + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 attributes associated with a specified secret in a + * given key vault. + * + * The UPDATE operation changes specified attributes of an existing stored + * secret. Attributes that are not specified in the request are left unchanged. + * The value of a secret itself cannot be changed. This operation requires the + * secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateSecret(vaultBaseUrl, secretName, secretVersion, 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 contentType = (options && options.contentType !== undefined) ? options.contentType : undefined; + let secretAttributes = (options && options.secretAttributes !== undefined) ? options.secretAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (secretVersion === null || secretVersion === undefined || typeof secretVersion.valueOf() !== 'string') { + throw new Error('secretVersion 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 (contentType !== null && contentType !== undefined && typeof contentType.valueOf() !== 'string') { + throw new Error('contentType must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((contentType !== null && contentType !== undefined) || (secretAttributes !== null && secretAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['SecretUpdateParameters'](); + parameters.contentType = contentType; + parameters.secretAttributes = secretAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'secrets/{secret-name}/{secret-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + requestUrl = requestUrl.replace('{secret-version}', encodeURIComponent(secretVersion)); + 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 = 'PATCH'; + 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['SecretUpdateParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 specified secret from a given key vault. + * + * The GET operation is applicable to any secret stored in Azure Key Vault. + * This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSecret(vaultBaseUrl, secretName, secretVersion, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (secretVersion === null || secretVersion === undefined || typeof secretVersion.valueOf() !== 'string') { + throw new Error('secretVersion 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('/') ? '' : '/') + 'secrets/{secret-name}/{secret-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + requestUrl = requestUrl.replace('{secret-version}', encodeURIComponent(secretVersion)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSecrets(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'secrets'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSecretVersions(vaultBaseUrl, secretName, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'secrets/{secret-name}/versions'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedSecrets(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'deletedsecrets'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 specified deleted secret. + * + * The Get Deleted Secret operation returns the specified deleted secret along + * with its attributes. This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedSecret(vaultBaseUrl, secretName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName 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('/') ? '' : '/') + 'deletedsecrets/{secret-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Permanently deletes the specified secret. + * + * The purge deleted secret operation removes the secret permanently, without + * the possibility of recovery. This operation can only be enabled on a + * soft-delete enabled vault. This operation requires the secrets/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _purgeDeletedSecret(vaultBaseUrl, secretName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName 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('/') ? '' : '/') + 'deletedsecrets/{secret-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + 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 = 'DELETE'; + 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 !== 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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 Recovers the deleted secret to the latest version. + * + * Recovers the deleted secret in the specified vault. This operation can only + * be performed on a soft-delete enabled vault. This operation requires the + * secrets/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the deleted secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _recoverDeletedSecret(vaultBaseUrl, secretName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName 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('/') ? '' : '/') + 'deletedsecrets/{secret-name}/recover'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Backs up the specified secret. + * + * Requests that a backup of the specified secret be downloaded to the client. + * All versions of the secret will be downloaded. This operation requires the + * secrets/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupSecretResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _backupSecret(vaultBaseUrl, secretName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName 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('/') ? '' : '/') + 'secrets/{secret-name}/backup'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackupSecretResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 backed up secret to a vault. + * + * Restores a backed up secret, and all its versions, to a vault. This + * operation requires the secrets/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} secretBundleBackup The backup blob associated with a secret + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreSecret(vaultBaseUrl, secretBundleBackup, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl 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 (!Buffer.isBuffer(secretBundleBackup)) { + throw new Error('secretBundleBackup cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if (secretBundleBackup !== null && secretBundleBackup !== undefined) { + parameters = new client.models['SecretRestoreParameters'](); + parameters.secretBundleBackup = secretBundleBackup; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'secrets/restore'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + 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['SecretRestoreParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificates(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + let includePending = (options && options.includePending !== undefined) ? options.includePending : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (includePending !== null && includePending !== undefined && typeof includePending !== 'boolean') { + throw new Error('includePending must be of type boolean.'); + } + 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('/') ? '' : '/') + 'certificates'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + if (includePending !== null && includePending !== undefined) { + queryParameters.push('includePending=' + encodeURIComponent(includePending.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 certificate from a specified key vault. + * + * Deletes all versions of a certificate object along with its associated + * policy. Delete certificate cannot be used to remove individual versions of a + * certificate object. This operation requires the certificates/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 DeletedCertificateBundle} for more + * information. + * + * {object} [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(vaultBaseUrl, certificateName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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('/') ? '' : '/') + 'certificates/{certificate-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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 = 'DELETE'; + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedCertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the certificate contacts for the specified key vault. + * + * Sets the certificate contacts for the specified key vault. This operation + * requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} contacts The contacts for the key vault certificate. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _setCertificateContacts(vaultBaseUrl, contacts, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (contacts === null || contacts === undefined) { + throw new Error('contacts 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('/') ? '' : '/') + 'certificates/contacts'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + 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 (contacts !== null && contacts !== undefined) { + let requestModelMapper = new client.models['Contacts']().mapper(); + requestModel = client.serialize(requestModelMapper, contacts, 'contacts'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(contacts, 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Contacts']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the certificate contacts for a specified key vault. + * + * The GetCertificateContacts operation returns the set of certificate contact + * resources in the specified key vault. This operation requires the + * certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateContacts(vaultBaseUrl, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl 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('/') ? '' : '/') + 'certificates/contacts'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Contacts']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 certificate contacts for a specified key vault. + * + * Deletes the certificate contacts for a specified key vault certificate. This + * operation requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteCertificateContacts(vaultBaseUrl, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl 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('/') ? '' : '/') + 'certificates/contacts'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + 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 = 'DELETE'; + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Contacts']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateIssuers(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'certificates/issuers'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateIssuerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the specified certificate issuer. + * + * The SetCertificateIssuer operation adds or updates the specified certificate + * issuer. This operation requires the certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {string} provider The issuer provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _setCertificateIssuer(vaultBaseUrl, issuerName, provider, 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 credentials = (options && options.credentials !== undefined) ? options.credentials : undefined; + let organizationDetails = (options && options.organizationDetails !== undefined) ? options.organizationDetails : undefined; + let attributes = (options && options.attributes !== undefined) ? options.attributes : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (issuerName === null || issuerName === undefined || typeof issuerName.valueOf() !== 'string') { + throw new Error('issuerName 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 (provider === null || provider === undefined || typeof provider.valueOf() !== 'string') { + throw new Error('provider 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); + } + let parameter; + if ((provider !== null && provider !== undefined) || (credentials !== null && credentials !== undefined) || (organizationDetails !== null && organizationDetails !== undefined) || (attributes !== null && attributes !== undefined)) { + parameter = new client.models['CertificateIssuerSetParameters'](); + parameter.provider = provider; + parameter.credentials = credentials; + parameter.organizationDetails = organizationDetails; + parameter.attributes = attributes; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/issuers/{issuer-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{issuer-name}', encodeURIComponent(issuerName)); + 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 (parameter !== null && parameter !== undefined) { + let requestModelMapper = new client.models['CertificateIssuerSetParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameter, 'parameter'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameter, 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['IssuerBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 specified certificate issuer. + * + * The UpdateCertificateIssuer operation performs an update on the specified + * certificate issuer entity. This operation requires the + * certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.provider] The issuer provider. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateCertificateIssuer(vaultBaseUrl, issuerName, 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 provider = (options && options.provider !== undefined) ? options.provider : undefined; + let credentials = (options && options.credentials !== undefined) ? options.credentials : undefined; + let organizationDetails = (options && options.organizationDetails !== undefined) ? options.organizationDetails : undefined; + let attributes = (options && options.attributes !== undefined) ? options.attributes : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (issuerName === null || issuerName === undefined || typeof issuerName.valueOf() !== 'string') { + throw new Error('issuerName 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 (provider !== null && provider !== undefined && typeof provider.valueOf() !== 'string') { + throw new Error('provider 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 parameter; + if ((provider !== null && provider !== undefined) || (credentials !== null && credentials !== undefined) || (organizationDetails !== null && organizationDetails !== undefined) || (attributes !== null && attributes !== undefined)) { + parameter = new client.models['CertificateIssuerUpdateParameters'](); + parameter.provider = provider; + parameter.credentials = credentials; + parameter.organizationDetails = organizationDetails; + parameter.attributes = attributes; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/issuers/{issuer-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{issuer-name}', encodeURIComponent(issuerName)); + 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 = 'PATCH'; + 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 (parameter !== null && parameter !== undefined) { + let requestModelMapper = new client.models['CertificateIssuerUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameter, 'parameter'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameter, 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['IssuerBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the specified certificate issuer. + * + * The GetCertificateIssuer operation returns the specified certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateIssuer(vaultBaseUrl, issuerName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (issuerName === null || issuerName === undefined || typeof issuerName.valueOf() !== 'string') { + throw new Error('issuerName 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('/') ? '' : '/') + 'certificates/issuers/{issuer-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{issuer-name}', encodeURIComponent(issuerName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['IssuerBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 specified certificate issuer. + * + * The DeleteCertificateIssuer operation permanently removes the specified + * certificate issuer from the vault. This operation requires the + * certificates/manageissuers/deleteissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteCertificateIssuer(vaultBaseUrl, issuerName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (issuerName === null || issuerName === undefined || typeof issuerName.valueOf() !== 'string') { + throw new Error('issuerName 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('/') ? '' : '/') + 'certificates/issuers/{issuer-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{issuer-name}', encodeURIComponent(issuerName)); + 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 = 'DELETE'; + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['IssuerBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 certificate. + * + * If this is the first version, the certificate resource is created. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createCertificate(vaultBaseUrl, certificateName, 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 certificatePolicy = (options && options.certificatePolicy !== undefined) ? options.certificatePolicy : undefined; + let certificateAttributes = (options && options.certificateAttributes !== undefined) ? options.certificateAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificateName !== null && certificateName !== undefined) { + if (certificateName.match(/^[0-9a-zA-Z-]+$/) === null) + { + throw new Error('"certificateName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z-]+$/'); + } + } + 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 (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((certificatePolicy !== null && certificatePolicy !== undefined) || (certificateAttributes !== null && certificateAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['CertificateCreateParameters'](); + parameters.certificatePolicy = certificatePolicy; + parameters.certificateAttributes = certificateAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/{certificate-name}/create'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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['CertificateCreateParameters']().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 !== 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['CertificateOperation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Imports a certificate into a specified key vault. + * + * Imports an existing valid certificate, containing a private key, into Azure + * Key Vault. The certificate to be imported can be in either PFX or PEM + * format. If the certificate is in PEM format the PEM file must contain the + * key as well as x509 certificates. This operation requires the + * certificates/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, 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 password = (options && options.password !== undefined) ? options.password : undefined; + let certificatePolicy = (options && options.certificatePolicy !== undefined) ? options.certificatePolicy : undefined; + let certificateAttributes = (options && options.certificateAttributes !== undefined) ? options.certificateAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificateName !== null && certificateName !== undefined) { + if (certificateName.match(/^[0-9a-zA-Z-]+$/) === null) + { + throw new Error('"certificateName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z-]+$/'); + } + } + 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 (base64EncodedCertificate === null || base64EncodedCertificate === undefined || typeof base64EncodedCertificate.valueOf() !== 'string') { + throw new Error('base64EncodedCertificate cannot be null or undefined and it must be of type string.'); + } + if (password !== null && password !== undefined && typeof password.valueOf() !== 'string') { + throw new Error('password must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((base64EncodedCertificate !== null && base64EncodedCertificate !== undefined) || (password !== null && password !== undefined) || (certificatePolicy !== null && certificatePolicy !== undefined) || (certificateAttributes !== null && certificateAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['CertificateImportParameters'](); + parameters.base64EncodedCertificate = base64EncodedCertificate; + parameters.password = password; + parameters.certificatePolicy = certificatePolicy; + parameters.certificateAttributes = certificateAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/{certificate-name}/import'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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['CertificateImportParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateVersions(vaultBaseUrl, certificateName, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'certificates/{certificate-name}/versions'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the policy for a certificate. + * + * The GetCertificatePolicy operation returns the specified certificate policy + * resources in the specified key vault. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in a given key + * vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificatePolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificatePolicy(vaultBaseUrl, certificateName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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('/') ? '' : '/') + 'certificates/{certificate-name}/policy'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificatePolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 policy for a certificate. + * + * Set specified members in the certificate policy. Leave others as null. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the + * same key pair will be used on certificate renewal. + * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. + * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC. + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificatePolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificatePolicy === null || certificatePolicy === undefined) { + throw new Error('certificatePolicy 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('/') ? '' : '/') + 'certificates/{certificate-name}/policy'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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 = 'PATCH'; + 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 (certificatePolicy !== null && certificatePolicy !== undefined) { + let requestModelMapper = new client.models['CertificatePolicy']().mapper(); + requestModel = client.serialize(requestModelMapper, certificatePolicy, 'certificatePolicy'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(certificatePolicy, 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificatePolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 specified attributes associated with the given + * certificate. + * + * The UpdateCertificate operation applies the specified update on the given + * certificate; the only elements updated are the certificate's attributes. + * This operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given key + * vault. + * + * @param {string} certificateVersion The version of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [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(vaultBaseUrl, certificateName, certificateVersion, 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 certificatePolicy = (options && options.certificatePolicy !== undefined) ? options.certificatePolicy : undefined; + let certificateAttributes = (options && options.certificateAttributes !== undefined) ? options.certificateAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificateVersion === null || certificateVersion === undefined || typeof certificateVersion.valueOf() !== 'string') { + throw new Error('certificateVersion 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 (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((certificatePolicy !== null && certificatePolicy !== undefined) || (certificateAttributes !== null && certificateAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['CertificateUpdateParameters'](); + parameters.certificatePolicy = certificatePolicy; + parameters.certificateAttributes = certificateAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/{certificate-name}/{certificate-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + requestUrl = requestUrl.replace('{certificate-version}', encodeURIComponent(certificateVersion)); + 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 = 'PATCH'; + 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['CertificateUpdateParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 information about a certificate. + * + * Gets information about a specific certificate. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {string} certificateVersion The version 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 CertificateBundle} for more information. + * + * {object} [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(vaultBaseUrl, certificateName, certificateVersion, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificateVersion === null || certificateVersion === undefined || typeof certificateVersion.valueOf() !== 'string') { + throw new Error('certificateVersion 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('/') ? '' : '/') + 'certificates/{certificate-name}/{certificate-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + requestUrl = requestUrl.replace('{certificate-version}', encodeURIComponent(certificateVersion)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 certificate operation. + * + * Updates a certificate creation operation that is already in progress. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate 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 CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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 (cancellationRequested === null || cancellationRequested === undefined || typeof cancellationRequested !== 'boolean') { + throw new Error('cancellationRequested cannot be null or undefined and it 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 certificateOperation; + if (cancellationRequested !== null && cancellationRequested !== undefined) { + certificateOperation = new client.models['CertificateOperationUpdateParameter'](); + certificateOperation.cancellationRequested = cancellationRequested; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/{certificate-name}/pending'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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 = 'PATCH'; + 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 (certificateOperation !== null && certificateOperation !== undefined) { + let requestModelMapper = new client.models['CertificateOperationUpdateParameter']().mapper(); + requestModel = client.serialize(requestModelMapper, certificateOperation, 'certificateOperation'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(certificateOperation, 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateOperation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 creation operation of a certificate. + * + * Gets the creation operation associated with a specified certificate. This + * operation requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateOperation(vaultBaseUrl, certificateName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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('/') ? '' : '/') + 'certificates/{certificate-name}/pending'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateOperation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 creation operation for a specific certificate. + * + * Deletes the creation operation for a specified certificate that is in the + * process of being created. The certificate is no longer created. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteCertificateOperation(vaultBaseUrl, certificateName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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('/') ? '' : '/') + 'certificates/{certificate-name}/pending'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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 = 'DELETE'; + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateOperation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Merges a certificate or a certificate chain with a key pair + * existing on the server. + * + * The MergeCertificate operation performs the merging of a certificate or + * certificate chain with a key pair currently available in the service. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, 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 certificateAttributes = (options && options.certificateAttributes !== undefined) ? options.certificateAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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 (!Array.isArray(x509Certificates)) { + throw new Error('x509Certificates cannot be null or undefined and it must be of type array.'); + } + for (let i = 0; i < x509Certificates.length; i++) { + if (x509Certificates[i] && !Buffer.isBuffer(x509Certificates[i])) { + throw new Error('x509Certificates[i] must be of type buffer.'); + } + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((x509Certificates !== null && x509Certificates !== undefined) || (certificateAttributes !== null && certificateAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['CertificateMergeParameters'](); + parameters.x509Certificates = x509Certificates; + parameters.certificateAttributes = certificateAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/{certificate-name}/pending/merge'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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['CertificateMergeParameters']().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 !== 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${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['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Backs up the specified certificate. + * + * Requests that a backup of the specified certificate be downloaded to the + * client. All versions of the certificate will be downloaded. This operation + * requires the certificates/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 BackupCertificateResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _backupCertificate(vaultBaseUrl, certificateName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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('/') ? '' : '/') + 'certificates/{certificate-name}/backup'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackupCertificateResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 backed up certificate to a vault. + * + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreCertificate(vaultBaseUrl, certificateBundleBackup, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl 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 (!Buffer.isBuffer(certificateBundleBackup)) { + throw new Error('certificateBundleBackup cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if (certificateBundleBackup !== null && certificateBundleBackup !== undefined) { + parameters = new client.models['CertificateRestoreParameters'](); + parameters.certificateBundleBackup = certificateBundleBackup; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/restore'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + 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['CertificateRestoreParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedCertificates(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + let includePending = (options && options.includePending !== undefined) ? options.includePending : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (includePending !== null && includePending !== undefined && typeof includePending !== 'boolean') { + throw new Error('includePending must be of type boolean.'); + } + 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('/') ? '' : '/') + 'deletedcertificates'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + if (includePending !== null && includePending !== undefined) { + queryParameters.push('includePending=' + encodeURIComponent(includePending.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedCertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 information about the specified deleted certificate. + * + * The GetDeletedCertificate operation retrieves the deleted certificate + * information plus its attributes, such as retention interval, scheduled + * permanent deletion and the current deletion recovery level. This operation + * requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 DeletedCertificateBundle} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedCertificate(vaultBaseUrl, certificateName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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('/') ? '' : '/') + 'deletedcertificates/{certificate-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedCertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Permanently deletes the specified deleted certificate. + * + * The PurgeDeletedCertificate operation performs an irreversible deletion of + * the specified certificate, without possibility for recovery. The operation + * is not available if the recovery level does not specify 'Purgeable'. This + * operation requires the certificate/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 _purgeDeletedCertificate(vaultBaseUrl, certificateName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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('/') ? '' : '/') + 'deletedcertificates/{certificate-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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 = 'DELETE'; + 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 !== 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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 Recovers the deleted certificate back to its current version under + * /certificates. + * + * The RecoverDeletedCertificate operation performs the reversal of the Delete + * operation. The operation is applicable in vaults enabled for soft-delete, + * and must be issued during the retention interval (available in the deleted + * certificate's attributes). This operation requires the certificates/recover + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the deleted 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 CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _recoverDeletedCertificate(vaultBaseUrl, certificateName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName 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('/') ? '' : '/') + 'deletedcertificates/{certificate-name}/recover'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getStorageAccounts(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'storage'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedStorageAccounts(vaultBaseUrl, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'deletedstorage'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedStorageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 specified deleted storage account. + * + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedStorageAccount(vaultBaseUrl, storageAccountName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'deletedstorage/{storage-account-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedStorageBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Permanently deletes the specified storage account. + * + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'deletedstorage/{storage-account-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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 = 'DELETE'; + 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 !== 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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 Recovers the deleted storage account. + * + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'deletedstorage/{storage-account-name}/recover'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Backs up the specified storage account. + * + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupStorageResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _backupStorageAccount(vaultBaseUrl, storageAccountName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName 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('/') ? '' : '/') + 'storage/{storage-account-name}/backup'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackupStorageResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 backed up storage account to a vault. + * + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreStorageAccount(vaultBaseUrl, storageBundleBackup, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl 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 (!Buffer.isBuffer(storageBundleBackup)) { + throw new Error('storageBundleBackup cannot be null or undefined and it must be of type buffer.'); + } + 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 parameters; + if (storageBundleBackup !== null && storageBundleBackup !== undefined) { + parameters = new client.models['StorageRestoreParameters'](); + parameters.storageBundleBackup = storageBundleBackup; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/restore'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + 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['StorageRestoreParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a storage account. This operation requires the storage/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteStorageAccount(vaultBaseUrl, storageAccountName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'storage/{storage-account-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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 = 'DELETE'; + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedStorageBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets information about a specified storage account. This operation requires + * the storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getStorageAccount(vaultBaseUrl, storageAccountName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'storage/{storage-account-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates or updates a new storage account. This operation requires the + * storage/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, 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 regenerationPeriod = (options && options.regenerationPeriod !== undefined) ? options.regenerationPeriod : undefined; + let storageAccountAttributes = (options && options.storageAccountAttributes !== undefined) ? options.storageAccountAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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 (resourceId === null || resourceId === undefined || typeof resourceId.valueOf() !== 'string') { + throw new Error('resourceId cannot be null or undefined and it must be of type string.'); + } + if (activeKeyName === null || activeKeyName === undefined || typeof activeKeyName.valueOf() !== 'string') { + throw new Error('activeKeyName cannot be null or undefined and it must be of type string.'); + } + if (autoRegenerateKey === null || autoRegenerateKey === undefined || typeof autoRegenerateKey !== 'boolean') { + throw new Error('autoRegenerateKey cannot be null or undefined and it must be of type boolean.'); + } + if (regenerationPeriod !== null && regenerationPeriod !== undefined && typeof regenerationPeriod.valueOf() !== 'string') { + throw new Error('regenerationPeriod must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((resourceId !== null && resourceId !== undefined) || (activeKeyName !== null && activeKeyName !== undefined) || (autoRegenerateKey !== null && autoRegenerateKey !== undefined) || (regenerationPeriod !== null && regenerationPeriod !== undefined) || (storageAccountAttributes !== null && storageAccountAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['StorageAccountCreateParameters'](); + parameters.resourceId = resourceId; + parameters.activeKeyName = activeKeyName; + parameters.autoRegenerateKey = autoRegenerateKey; + parameters.regenerationPeriod = regenerationPeriod; + parameters.storageAccountAttributes = storageAccountAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['StorageAccountCreateParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateStorageAccount(vaultBaseUrl, storageAccountName, 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 activeKeyName = (options && options.activeKeyName !== undefined) ? options.activeKeyName : undefined; + let autoRegenerateKey = (options && options.autoRegenerateKey !== undefined) ? options.autoRegenerateKey : undefined; + let regenerationPeriod = (options && options.regenerationPeriod !== undefined) ? options.regenerationPeriod : undefined; + let storageAccountAttributes = (options && options.storageAccountAttributes !== undefined) ? options.storageAccountAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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 (activeKeyName !== null && activeKeyName !== undefined && typeof activeKeyName.valueOf() !== 'string') { + throw new Error('activeKeyName must be of type string.'); + } + if (autoRegenerateKey !== null && autoRegenerateKey !== undefined && typeof autoRegenerateKey !== 'boolean') { + throw new Error('autoRegenerateKey must be of type boolean.'); + } + if (regenerationPeriod !== null && regenerationPeriod !== undefined && typeof regenerationPeriod.valueOf() !== 'string') { + throw new Error('regenerationPeriod must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((activeKeyName !== null && activeKeyName !== undefined) || (autoRegenerateKey !== null && autoRegenerateKey !== undefined) || (regenerationPeriod !== null && regenerationPeriod !== undefined) || (storageAccountAttributes !== null && storageAccountAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['StorageAccountUpdateParameters'](); + parameters.activeKeyName = activeKeyName; + parameters.autoRegenerateKey = autoRegenerateKey; + parameters.regenerationPeriod = regenerationPeriod; + parameters.storageAccountAttributes = storageAccountAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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 = 'PATCH'; + 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['StorageAccountUpdateParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} keyName The storage account key 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 StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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 (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName 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); + } + let parameters; + if (keyName !== null && keyName !== undefined) { + parameters = new client.models['StorageAccountRegenerteKeyParameters'](); + parameters.keyName = keyName; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/regeneratekey'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + 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['StorageAccountRegenerteKeyParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSasDefinitions(vaultBaseUrl, storageAccountName, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'storage/{storage-account-name}/sas'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SasDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, 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 maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + 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('/') ? '' : '/') + 'deletedstorage/{storage-account-name}/sas'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSasDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionBundle} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'deletedstorage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSasDefinitionBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a SAS definition from a specified storage account. This operation + * requires the storage/deletesas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionBundle} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + 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 = 'DELETE'; + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSasDefinitionBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets information about a SAS definition for the specified storage account. + * This operation requires the storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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 (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + 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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates or updates a new SAS definition for the specified storage account. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, 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 sasDefinitionAttributes = (options && options.sasDefinitionAttributes !== undefined) ? options.sasDefinitionAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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 (templateUri === null || templateUri === undefined || typeof templateUri.valueOf() !== 'string') { + throw new Error('templateUri cannot be null or undefined and it must be of type string.'); + } + if (sasType === null || sasType === undefined || typeof sasType.valueOf() !== 'string') { + throw new Error('sasType cannot be null or undefined and it must be of type string.'); + } + if (validityPeriod === null || validityPeriod === undefined || typeof validityPeriod.valueOf() !== 'string') { + throw new Error('validityPeriod cannot be null or undefined and it must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((templateUri !== null && templateUri !== undefined) || (sasType !== null && sasType !== undefined) || (validityPeriod !== null && validityPeriod !== undefined) || (sasDefinitionAttributes !== null && sasDefinitionAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['SasDefinitionCreateParameters'](); + parameters.templateUri = templateUri; + parameters.sasType = sasType; + parameters.validityPeriod = validityPeriod; + parameters.sasDefinitionAttributes = sasDefinitionAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['SasDefinitionCreateParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates the specified attributes associated with the given SAS definition. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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 templateUri = (options && options.templateUri !== undefined) ? options.templateUri : undefined; + let sasType = (options && options.sasType !== undefined) ? options.sasType : undefined; + let validityPeriod = (options && options.validityPeriod !== undefined) ? options.validityPeriod : undefined; + let sasDefinitionAttributes = (options && options.sasDefinitionAttributes !== undefined) ? options.sasDefinitionAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + 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 (templateUri !== null && templateUri !== undefined && typeof templateUri.valueOf() !== 'string') { + throw new Error('templateUri must be of type string.'); + } + if (sasType !== null && sasType !== undefined && typeof sasType.valueOf() !== 'string') { + throw new Error('sasType must be of type string.'); + } + if (validityPeriod !== null && validityPeriod !== undefined && typeof validityPeriod.valueOf() !== 'string') { + throw new Error('validityPeriod must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] 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 parameters; + if ((templateUri !== null && templateUri !== undefined) || (sasType !== null && sasType !== undefined) || (validityPeriod !== null && validityPeriod !== undefined) || (sasDefinitionAttributes !== null && sasDefinitionAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['SasDefinitionUpdateParameters'](); + parameters.templateUri = templateUri; + parameters.sasType = sasType; + parameters.validityPeriod = validityPeriod; + parameters.sasDefinitionAttributes = sasDefinitionAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + 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 = 'PATCH'; + 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['SasDefinitionUpdateParameters']().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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getKeyVersionsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getKeysNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['KeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 DeletedKeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedKeysNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedKeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSecretsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSecretVersionsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 DeletedSecretListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedSecretsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificatesNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateIssuersNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateIssuerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateVersionsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} nextPageLink The NextLink from the previous 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 DeletedCertificateListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedCertificatesNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedCertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 StorageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getStorageAccountsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 DeletedStorageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedStorageAccountsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedStorageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 SasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSasDefinitionsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SasDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 DeletedSasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedSasDefinitionsNext(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['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSasDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 KeyVaultClient. */ +class KeyVaultClient extends ServiceClient { + /** + * Create a KeyVaultClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @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, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.apiVersion = '7.0'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = '{vaultBaseUrl}'; + this.credentials = credentials; + + 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.models = models; + this._createKey = _createKey; + this._importKey = _importKey; + this._deleteKey = _deleteKey; + this._updateKey = _updateKey; + this._getKey = _getKey; + this._getKeyVersions = _getKeyVersions; + this._getKeys = _getKeys; + this._backupKey = _backupKey; + this._restoreKey = _restoreKey; + this._encrypt = _encrypt; + this._decrypt = _decrypt; + this._sign = _sign; + this._verify = _verify; + this._wrapKey = _wrapKey; + this._unwrapKey = _unwrapKey; + this._getDeletedKeys = _getDeletedKeys; + this._getDeletedKey = _getDeletedKey; + this._purgeDeletedKey = _purgeDeletedKey; + this._recoverDeletedKey = _recoverDeletedKey; + this._setSecret = _setSecret; + this._deleteSecret = _deleteSecret; + this._updateSecret = _updateSecret; + this._getSecret = _getSecret; + this._getSecrets = _getSecrets; + this._getSecretVersions = _getSecretVersions; + this._getDeletedSecrets = _getDeletedSecrets; + this._getDeletedSecret = _getDeletedSecret; + this._purgeDeletedSecret = _purgeDeletedSecret; + this._recoverDeletedSecret = _recoverDeletedSecret; + this._backupSecret = _backupSecret; + this._restoreSecret = _restoreSecret; + this._getCertificates = _getCertificates; + this._deleteCertificate = _deleteCertificate; + this._setCertificateContacts = _setCertificateContacts; + this._getCertificateContacts = _getCertificateContacts; + this._deleteCertificateContacts = _deleteCertificateContacts; + this._getCertificateIssuers = _getCertificateIssuers; + this._setCertificateIssuer = _setCertificateIssuer; + this._updateCertificateIssuer = _updateCertificateIssuer; + this._getCertificateIssuer = _getCertificateIssuer; + this._deleteCertificateIssuer = _deleteCertificateIssuer; + this._createCertificate = _createCertificate; + this._importCertificate = _importCertificate; + this._getCertificateVersions = _getCertificateVersions; + this._getCertificatePolicy = _getCertificatePolicy; + this._updateCertificatePolicy = _updateCertificatePolicy; + this._updateCertificate = _updateCertificate; + this._getCertificate = _getCertificate; + this._updateCertificateOperation = _updateCertificateOperation; + this._getCertificateOperation = _getCertificateOperation; + this._deleteCertificateOperation = _deleteCertificateOperation; + this._mergeCertificate = _mergeCertificate; + this._backupCertificate = _backupCertificate; + this._restoreCertificate = _restoreCertificate; + this._getDeletedCertificates = _getDeletedCertificates; + this._getDeletedCertificate = _getDeletedCertificate; + this._purgeDeletedCertificate = _purgeDeletedCertificate; + this._recoverDeletedCertificate = _recoverDeletedCertificate; + this._getStorageAccounts = _getStorageAccounts; + this._getDeletedStorageAccounts = _getDeletedStorageAccounts; + this._getDeletedStorageAccount = _getDeletedStorageAccount; + this._purgeDeletedStorageAccount = _purgeDeletedStorageAccount; + this._recoverDeletedStorageAccount = _recoverDeletedStorageAccount; + this._backupStorageAccount = _backupStorageAccount; + this._restoreStorageAccount = _restoreStorageAccount; + this._deleteStorageAccount = _deleteStorageAccount; + this._getStorageAccount = _getStorageAccount; + this._setStorageAccount = _setStorageAccount; + this._updateStorageAccount = _updateStorageAccount; + this._regenerateStorageAccountKey = _regenerateStorageAccountKey; + this._getSasDefinitions = _getSasDefinitions; + this._getDeletedSasDefinitions = _getDeletedSasDefinitions; + this._getDeletedSasDefinition = _getDeletedSasDefinition; + this._recoverDeletedSasDefinition = _recoverDeletedSasDefinition; + this._deleteSasDefinition = _deleteSasDefinition; + this._getSasDefinition = _getSasDefinition; + this._setSasDefinition = _setSasDefinition; + this._updateSasDefinition = _updateSasDefinition; + this._getKeyVersionsNext = _getKeyVersionsNext; + this._getKeysNext = _getKeysNext; + this._getDeletedKeysNext = _getDeletedKeysNext; + this._getSecretsNext = _getSecretsNext; + this._getSecretVersionsNext = _getSecretVersionsNext; + this._getDeletedSecretsNext = _getDeletedSecretsNext; + this._getCertificatesNext = _getCertificatesNext; + this._getCertificateIssuersNext = _getCertificateIssuersNext; + this._getCertificateVersionsNext = _getCertificateVersionsNext; + this._getDeletedCertificatesNext = _getDeletedCertificatesNext; + this._getStorageAccountsNext = _getStorageAccountsNext; + this._getDeletedStorageAccountsNext = _getDeletedStorageAccountsNext; + this._getSasDefinitionsNext = _getSasDefinitionsNext; + this._getDeletedSasDefinitionsNext = _getDeletedSasDefinitionsNext; + msRest.addSerializationMixin(this); + } + + /** + * @summary Creates a new key, stores it, then returns key parameters and + * attributes to the client. + * + * The create key operation can be used to create any key type in Azure Key + * Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. It requires the keys/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name for the new key. The system will generate + * the version name for the new key. + * + * @param {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bits. For example: 2048, + * 3072, or 4096 for RSA. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createKeyWithHttpOperationResponse(vaultBaseUrl, keyName, kty, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._createKey(vaultBaseUrl, keyName, kty, 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 key, stores it, then returns key parameters and + * attributes to the client. + * + * The create key operation can be used to create any key type in Azure Key + * Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. It requires the keys/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name for the new key. The system will generate + * the version name for the new key. + * + * @param {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bits. For example: 2048, + * 3072, or 4096 for RSA. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createKey(vaultBaseUrl, keyName, kty, 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._createKey(vaultBaseUrl, keyName, kty, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createKey(vaultBaseUrl, keyName, kty, options, optionalCallback); + } + } + + /** + * @summary Imports an externally created key, stores it, and returns key + * parameters and attributes to the client. + * + * The import key operation may be used to import any key type into an Azure + * Key Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. This operation requires the keys/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName Name for the imported key. + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key identifier. + * + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus. + * + * @param {buffer} [key.e] RSA public exponent. + * + * @param {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * + * @param {buffer} [key.dp] RSA private key parameter. + * + * @param {buffer} [key.dq] RSA private key parameter. + * + * @param {buffer} [key.qi] RSA private key parameter. + * + * @param {buffer} [key.p] RSA secret prime. + * + * @param {buffer} [key.q] RSA secret prime, with p < q. + * + * @param {buffer} [key.k] Symmetric key. + * + * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * + * @param {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {buffer} [key.x] X component of an EC public key. + * + * @param {buffer} [key.y] Y component of an EC public key. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key. + * + * @param {object} [options.keyAttributes] The key management attributes. + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + importKeyWithHttpOperationResponse(vaultBaseUrl, keyName, key, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._importKey(vaultBaseUrl, keyName, key, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Imports an externally created key, stores it, and returns key + * parameters and attributes to the client. + * + * The import key operation may be used to import any key type into an Azure + * Key Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. This operation requires the keys/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName Name for the imported key. + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key identifier. + * + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus. + * + * @param {buffer} [key.e] RSA public exponent. + * + * @param {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * + * @param {buffer} [key.dp] RSA private key parameter. + * + * @param {buffer} [key.dq] RSA private key parameter. + * + * @param {buffer} [key.qi] RSA private key parameter. + * + * @param {buffer} [key.p] RSA secret prime. + * + * @param {buffer} [key.q] RSA secret prime, with p < q. + * + * @param {buffer} [key.k] Symmetric key. + * + * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * + * @param {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {buffer} [key.x] X component of an EC public key. + * + * @param {buffer} [key.y] Y component of an EC public key. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key. + * + * @param {object} [options.keyAttributes] The key management attributes. + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + importKey(vaultBaseUrl, keyName, key, 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._importKey(vaultBaseUrl, keyName, key, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._importKey(vaultBaseUrl, keyName, key, options, optionalCallback); + } + } + + /** + * @summary Deletes a key of any type from storage in Azure Key Vault. + * + * The delete key operation cannot be used to remove individual versions of a + * key. This operation removes the cryptographic material associated with the + * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or + * Encrypt/Decrypt operations. This operation requires the keys/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteKey(vaultBaseUrl, keyName, 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 key of any type from storage in Azure Key Vault. + * + * The delete key operation cannot be used to remove individual versions of a + * key. This operation removes the cryptographic material associated with the + * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or + * Encrypt/Decrypt operations. This operation requires the keys/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedKeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteKey(vaultBaseUrl, keyName, 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._deleteKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteKey(vaultBaseUrl, keyName, options, optionalCallback); + } + } + + /** + * @summary The update key operation changes specified attributes of a stored + * key and can be applied to any key type and key version stored in Azure Key + * Vault. + * + * In order to perform this operation, the key must already exist in the Key + * Vault. Note: The cryptographic material of a key itself cannot be changed. + * This operation requires the keys/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of key to update. + * + * @param {string} keyVersion The version of the key to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary The update key operation changes specified attributes of a stored + * key and can be applied to any key type and key version stored in Azure Key + * Vault. + * + * In order to perform this operation, the key must already exist in the Key + * Vault. Note: The cryptographic material of a key itself cannot be changed. + * This operation requires the keys/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of key to update. + * + * @param {string} keyVersion The version of the key to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateKey(vaultBaseUrl, keyName, keyVersion, 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._updateKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback); + } + } + + /** + * @summary Gets the public part of a stored key. + * + * The get key operation is applicable to all key types. If the requested key + * is symmetric, then no key material is released in the response. This + * operation requires the keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to get. + * + * @param {string} keyVersion Adding the version parameter retrieves a specific + * version of a key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getKey(vaultBaseUrl, keyName, keyVersion, 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 public part of a stored key. + * + * The get key operation is applicable to all key types. If the requested key + * is symmetric, then no key material is released in the response. This + * operation requires the keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to get. + * + * @param {string} keyVersion Adding the version parameter retrieves a specific + * version of a key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getKey(vaultBaseUrl, keyName, keyVersion, 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._getKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback); + } + } + + /** + * @summary Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getKeyVersionsWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getKeyVersions(vaultBaseUrl, keyName, 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 list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getKeyVersions(vaultBaseUrl, keyName, 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._getKeyVersions(vaultBaseUrl, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getKeyVersions(vaultBaseUrl, keyName, options, optionalCallback); + } + } + + /** + * @summary List keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getKeysWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getKeys(vaultBaseUrl, 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 keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getKeys(vaultBaseUrl, 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._getKeys(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getKeys(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Requests that a backup of the specified key be downloaded to the + * client. + * + * The Key Backup operation exports a key from Azure Key Vault in a protected + * form. Note that this operation does NOT return key material in a form that + * can be used outside the Azure Key Vault system, the returned key material is + * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The + * intent of this operation is to allow a client to GENERATE a key in one Azure + * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure + * Key Vault instance. The BACKUP operation may be used to export, in protected + * form, any key type from Azure Key Vault. Individual versions of a key cannot + * be backed up. BACKUP / RESTORE can be performed within geographical + * boundaries only; meaning that a BACKUP from one geographical area cannot be + * restored to another geographical area. For example, a backup from the US + * geographical area cannot be restored in an EU geographical area. This + * operation requires the key/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + backupKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._backupKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Requests that a backup of the specified key be downloaded to the + * client. + * + * The Key Backup operation exports a key from Azure Key Vault in a protected + * form. Note that this operation does NOT return key material in a form that + * can be used outside the Azure Key Vault system, the returned key material is + * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The + * intent of this operation is to allow a client to GENERATE a key in one Azure + * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure + * Key Vault instance. The BACKUP operation may be used to export, in protected + * form, any key type from Azure Key Vault. Individual versions of a key cannot + * be backed up. BACKUP / RESTORE can be performed within geographical + * boundaries only; meaning that a BACKUP from one geographical area cannot be + * restored to another geographical area. For example, a backup from the US + * geographical area cannot be restored in an EU geographical area. This + * operation requires the key/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BackupKeyResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupKeyResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + backupKey(vaultBaseUrl, keyName, 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._backupKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._backupKey(vaultBaseUrl, keyName, options, optionalCallback); + } + } + + /** + * @summary Restores a backed up key to a vault. + * + * Imports a previously backed up key into Azure Key Vault, restoring the key, + * its key identifier, attributes and access control policies. The RESTORE + * operation may be used to import a previously backed up key. Individual + * versions of a key cannot be restored. The key is restored in its entirety + * with the same key name as it had when it was backed up. If the key name is + * not available in the target Key Vault, the RESTORE operation will be + * rejected. While the key name is retained during restore, the final key + * identifier will change if the key is restored to a different vault. Restore + * will restore all versions and preserve version identifiers. The RESTORE + * operation is subject to security constraints: The target Key Vault must be + * owned by the same Microsoft Azure Subscription as the source Key Vault The + * user must have RESTORE permission in the target Key Vault. This operation + * requires the keys/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} keyBundleBackup The backup blob associated with a key + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + restoreKeyWithHttpOperationResponse(vaultBaseUrl, keyBundleBackup, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._restoreKey(vaultBaseUrl, keyBundleBackup, 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 backed up key to a vault. + * + * Imports a previously backed up key into Azure Key Vault, restoring the key, + * its key identifier, attributes and access control policies. The RESTORE + * operation may be used to import a previously backed up key. Individual + * versions of a key cannot be restored. The key is restored in its entirety + * with the same key name as it had when it was backed up. If the key name is + * not available in the target Key Vault, the RESTORE operation will be + * rejected. While the key name is retained during restore, the final key + * identifier will change if the key is restored to a different vault. Restore + * will restore all versions and preserve version identifiers. The RESTORE + * operation is subject to security constraints: The target Key Vault must be + * owned by the same Microsoft Azure Subscription as the source Key Vault The + * user must have RESTORE permission in the target Key Vault. This operation + * requires the keys/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} keyBundleBackup The backup blob associated with a key + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreKey(vaultBaseUrl, keyBundleBackup, 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._restoreKey(vaultBaseUrl, keyBundleBackup, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreKey(vaultBaseUrl, keyBundleBackup, options, optionalCallback); + } + } + + /** + * @summary Encrypts an arbitrary sequence of bytes using an encryption key + * that is stored in a key vault. + * + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an + * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT + * operation only supports a single block of data, the size of which is + * dependent on the target key and the encryption algorithm to be used. The + * ENCRYPT operation is only strictly necessary for symmetric keys stored in + * Azure Key Vault since protection with an asymmetric key can be performed + * using public portion of the key. This operation is supported for asymmetric + * keys as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/encypt + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + encryptWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Encrypts an arbitrary sequence of bytes using an encryption key + * that is stored in a key vault. + * + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an + * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT + * operation only supports a single block of data, the size of which is + * dependent on the target key and the encryption algorithm to be used. The + * ENCRYPT operation is only strictly necessary for symmetric keys stored in + * Azure Key Vault since protection with an asymmetric key can be performed + * using public portion of the key. This operation is supported for asymmetric + * keys as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/encypt + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + } + } + + /** + * @summary Decrypts a single block of encrypted data. + * + * The DECRYPT operation decrypts a well-formed block of ciphertext using the + * target encryption key and specified algorithm. This operation is the reverse + * of the ENCRYPT operation; only a single block of data may be decrypted, the + * size of this block is dependent on the target key and the algorithm to be + * used. The DECRYPT operation applies to asymmetric and symmetric keys stored + * in Azure Key Vault since it uses the private portion of the key. This + * operation requires the keys/decrypt permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + decryptWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Decrypts a single block of encrypted data. + * + * The DECRYPT operation decrypts a well-formed block of ciphertext using the + * target encryption key and specified algorithm. This operation is the reverse + * of the ENCRYPT operation; only a single block of data may be decrypted, the + * size of this block is dependent on the target key and the algorithm to be + * used. The DECRYPT operation applies to asymmetric and symmetric keys stored + * in Azure Key Vault since it uses the private portion of the key. This + * operation requires the keys/decrypt permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + } + } + + /** + * @summary Creates a signature from a digest using the specified key. + * + * The SIGN operation is applicable to asymmetric and symmetric keys stored in + * Azure Key Vault since this operation uses the private portion of the key. + * This operation requires the keys/sign permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm identifier. For + * more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + signWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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 signature from a digest using the specified key. + * + * The SIGN operation is applicable to asymmetric and symmetric keys stored in + * Azure Key Vault since this operation uses the private portion of the key. + * This operation requires the keys/sign permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm identifier. For + * more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + } + } + + /** + * @summary Verifies a signature using a specified key. + * + * The VERIFY operation is applicable to symmetric keys stored in Azure Key + * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure + * Key Vault since signature verification can be performed using the public + * portion of the key but this operation is supported as a convenience for + * callers that only have a key-reference and not the public portion of the + * key. This operation requires the keys/verify permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * + * @param {buffer} digest The digest used for signing. + * + * @param {buffer} signature The signature to be verified. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + verifyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, 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 a signature using a specified key. + * + * The VERIFY operation is applicable to symmetric keys stored in Azure Key + * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure + * Key Vault since signature verification can be performed using the public + * portion of the key but this operation is supported as a convenience for + * callers that only have a key-reference and not the public portion of the + * key. This operation requires the keys/verify permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * + * @param {buffer} digest The digest used for signing. + * + * @param {buffer} signature The signature to be verified. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyVerifyResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyVerifyResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, 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._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, optionalCallback); + } + } + + /** + * @summary Wraps a symmetric key using a specified key. + * + * The WRAP operation supports encryption of a symmetric key using a key + * encryption key that has previously been stored in an Azure Key Vault. The + * WRAP operation is only strictly necessary for symmetric keys stored in Azure + * Key Vault since protection with an asymmetric key can be performed using the + * public portion of the key. This operation is supported for asymmetric keys + * as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/wrapKey + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + wrapKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Wraps a symmetric key using a specified key. + * + * The WRAP operation supports encryption of a symmetric key using a key + * encryption key that has previously been stored in an Azure Key Vault. The + * WRAP operation is only strictly necessary for symmetric keys stored in Azure + * Key Vault since protection with an asymmetric key can be performed using the + * public portion of the key. This operation is supported for asymmetric keys + * as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/wrapKey + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + } + } + + /** + * @summary Unwraps a symmetric key using the specified key that was initially + * used for wrapping that key. + * + * The UNWRAP operation supports decryption of a symmetric key using the target + * key encryption key. This operation is the reverse of the WRAP operation. The + * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure + * Key Vault since it uses the private portion of the key. This operation + * requires the keys/unwrapKey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + unwrapKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Unwraps a symmetric key using the specified key that was initially + * used for wrapping that key. + * + * The UNWRAP operation supports decryption of a symmetric key using the target + * key encryption key. This operation is the reverse of the WRAP operation. The + * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure + * Key Vault since it uses the private portion of the key. This operation + * requires the keys/unwrapKey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyOperationResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, 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._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + } + } + + /** + * @summary Lists the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedKeysWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedKeys(vaultBaseUrl, 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 the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedKeyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedKeys(vaultBaseUrl, 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._getDeletedKeys(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedKeys(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Gets the public part of a deleted key. + * + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. + * While the operation can be invoked on any vault, it will return an error if + * invoked on a non soft-delete enabled vault. This operation requires the + * keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedKey(vaultBaseUrl, keyName, 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 public part of a deleted key. + * + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. + * While the operation can be invoked on any vault, it will return an error if + * invoked on a non soft-delete enabled vault. This operation requires the + * keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedKeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedKey(vaultBaseUrl, keyName, 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._getDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); + } + } + + /** + * @summary Permanently deletes the specified key. + * + * The Purge Deleted Key operation is applicable for soft-delete enabled + * vaults. While the operation can be invoked on any vault, it will return an + * error if invoked on a non soft-delete enabled vault. This operation requires + * the keys/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + purgeDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._purgeDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Permanently deletes the specified key. + * + * The Purge Deleted Key operation is applicable for soft-delete enabled + * vaults. While the operation can be invoked on any vault, it will return an + * error if invoked on a non soft-delete enabled vault. This operation requires + * the keys/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + purgeDeletedKey(vaultBaseUrl, keyName, 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._purgeDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._purgeDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); + } + } + + /** + * @summary Recovers the deleted key to its latest version. + * + * The Recover Deleted Key operation is applicable for deleted keys in + * soft-delete enabled vaults. It recovers the deleted key back to its latest + * version under /keys. An attempt to recover an non-deleted key will return an + * error. Consider this the inverse of the delete operation on soft-delete + * enabled vaults. This operation requires the keys/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the deleted key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + recoverDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._recoverDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Recovers the deleted key to its latest version. + * + * The Recover Deleted Key operation is applicable for deleted keys in + * soft-delete enabled vaults. It recovers the deleted key back to its latest + * version under /keys. An attempt to recover an non-deleted key will return an + * error. Consider this the inverse of the delete operation on soft-delete + * enabled vaults. This operation requires the keys/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the deleted key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedKey(vaultBaseUrl, keyName, 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._recoverDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); + } + } + + /** + * @summary Sets a secret in a specified key vault. + * + * The SET operation adds a secret to the Azure Key Vault. If the named secret + * already exists, Azure Key Vault creates a new version of that secret. This + * operation requires the secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} value The value of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + setSecretWithHttpOperationResponse(vaultBaseUrl, secretName, value, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._setSecret(vaultBaseUrl, secretName, value, 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 a secret in a specified key vault. + * + * The SET operation adds a secret to the Azure Key Vault. If the named secret + * already exists, Azure Key Vault creates a new version of that secret. This + * operation requires the secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} value The value of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + setSecret(vaultBaseUrl, secretName, value, 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._setSecret(vaultBaseUrl, secretName, value, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setSecret(vaultBaseUrl, secretName, value, options, optionalCallback); + } + } + + /** + * @summary Deletes a secret from a specified key vault. + * + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE + * cannot be applied to an individual version of a secret. This operation + * requires the secrets/delete permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSecret(vaultBaseUrl, secretName, 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 secret from a specified key vault. + * + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE + * cannot be applied to an individual version of a secret. This operation + * requires the secrets/delete permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedSecretBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSecret(vaultBaseUrl, secretName, 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._deleteSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSecret(vaultBaseUrl, secretName, options, optionalCallback); + } + } + + /** + * @summary Updates the attributes associated with a specified secret in a + * given key vault. + * + * The UPDATE operation changes specified attributes of an existing stored + * secret. Attributes that are not specified in the request are left unchanged. + * The value of a secret itself cannot be changed. This operation requires the + * secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateSecretWithHttpOperationResponse(vaultBaseUrl, secretName, secretVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateSecret(vaultBaseUrl, secretName, secretVersion, 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 attributes associated with a specified secret in a + * given key vault. + * + * The UPDATE operation changes specified attributes of an existing stored + * secret. Attributes that are not specified in the request are left unchanged. + * The value of a secret itself cannot be changed. This operation requires the + * secrets/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateSecret(vaultBaseUrl, secretName, secretVersion, 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._updateSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback); + } + } + + /** + * @summary Get a specified secret from a given key vault. + * + * The GET operation is applicable to any secret stored in Azure Key Vault. + * This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSecretWithHttpOperationResponse(vaultBaseUrl, secretName, secretVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSecret(vaultBaseUrl, secretName, secretVersion, 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 specified secret from a given key vault. + * + * The GET operation is applicable to any secret stored in Azure Key Vault. + * This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSecret(vaultBaseUrl, secretName, secretVersion, 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._getSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback); + } + } + + /** + * @summary List secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSecretsWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSecrets(vaultBaseUrl, 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 secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSecrets(vaultBaseUrl, 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._getSecrets(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSecrets(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary List all versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSecretVersionsWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSecretVersions(vaultBaseUrl, secretName, 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 versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSecretVersions(vaultBaseUrl, secretName, 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._getSecretVersions(vaultBaseUrl, secretName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSecretVersions(vaultBaseUrl, secretName, options, optionalCallback); + } + } + + /** + * @summary Lists deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedSecretsWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedSecrets(vaultBaseUrl, 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 deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedSecretListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSecrets(vaultBaseUrl, 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._getDeletedSecrets(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedSecrets(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Gets the specified deleted secret. + * + * The Get Deleted Secret operation returns the specified deleted secret along + * with its attributes. This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedSecret(vaultBaseUrl, secretName, 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 specified deleted secret. + * + * The Get Deleted Secret operation returns the specified deleted secret along + * with its attributes. This operation requires the secrets/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedSecretBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSecret(vaultBaseUrl, secretName, 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._getDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); + } + } + + /** + * @summary Permanently deletes the specified secret. + * + * The purge deleted secret operation removes the secret permanently, without + * the possibility of recovery. This operation can only be enabled on a + * soft-delete enabled vault. This operation requires the secrets/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + purgeDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._purgeDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Permanently deletes the specified secret. + * + * The purge deleted secret operation removes the secret permanently, without + * the possibility of recovery. This operation can only be enabled on a + * soft-delete enabled vault. This operation requires the secrets/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + purgeDeletedSecret(vaultBaseUrl, secretName, 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._purgeDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._purgeDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); + } + } + + /** + * @summary Recovers the deleted secret to the latest version. + * + * Recovers the deleted secret in the specified vault. This operation can only + * be performed on a soft-delete enabled vault. This operation requires the + * secrets/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the deleted secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + recoverDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._recoverDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Recovers the deleted secret to the latest version. + * + * Recovers the deleted secret in the specified vault. This operation can only + * be performed on a soft-delete enabled vault. This operation requires the + * secrets/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the deleted secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedSecret(vaultBaseUrl, secretName, 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._recoverDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); + } + } + + /** + * @summary Backs up the specified secret. + * + * Requests that a backup of the specified secret be downloaded to the client. + * All versions of the secret will be downloaded. This operation requires the + * secrets/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + backupSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._backupSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Backs up the specified secret. + * + * Requests that a backup of the specified secret be downloaded to the client. + * All versions of the secret will be downloaded. This operation requires the + * secrets/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} secretName The name of the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BackupSecretResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupSecretResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + backupSecret(vaultBaseUrl, secretName, 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._backupSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._backupSecret(vaultBaseUrl, secretName, options, optionalCallback); + } + } + + /** + * @summary Restores a backed up secret to a vault. + * + * Restores a backed up secret, and all its versions, to a vault. This + * operation requires the secrets/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} secretBundleBackup The backup blob associated with a secret + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + restoreSecretWithHttpOperationResponse(vaultBaseUrl, secretBundleBackup, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._restoreSecret(vaultBaseUrl, secretBundleBackup, 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 backed up secret to a vault. + * + * Restores a backed up secret, and all its versions, to a vault. This + * operation requires the secrets/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} secretBundleBackup The backup blob associated with a secret + * bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreSecret(vaultBaseUrl, secretBundleBackup, 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._restoreSecret(vaultBaseUrl, secretBundleBackup, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreSecret(vaultBaseUrl, secretBundleBackup, options, optionalCallback); + } + } + + /** + * @summary List certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificatesWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificates(vaultBaseUrl, 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 certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificates(vaultBaseUrl, 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._getCertificates(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificates(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Deletes a certificate from a specified key vault. + * + * Deletes all versions of a certificate object along with its associated + * policy. Delete certificate cannot be used to remove individual versions of a + * certificate object. This operation requires the certificates/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteCertificate(vaultBaseUrl, certificateName, 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 certificate from a specified key vault. + * + * Deletes all versions of a certificate object along with its associated + * policy. Delete certificate cannot be used to remove individual versions of a + * certificate object. This operation requires the certificates/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {DeletedCertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateBundle} for more + * information. + * + * {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(vaultBaseUrl, certificateName, 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._deleteCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Sets the certificate contacts for the specified key vault. + * + * Sets the certificate contacts for the specified key vault. This operation + * requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} contacts The contacts for the key vault certificate. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + setCertificateContactsWithHttpOperationResponse(vaultBaseUrl, contacts, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._setCertificateContacts(vaultBaseUrl, contacts, 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 the certificate contacts for the specified key vault. + * + * Sets the certificate contacts for the specified key vault. This operation + * requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} contacts The contacts for the key vault certificate. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Contacts} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + setCertificateContacts(vaultBaseUrl, contacts, 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._setCertificateContacts(vaultBaseUrl, contacts, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setCertificateContacts(vaultBaseUrl, contacts, options, optionalCallback); + } + } + + /** + * @summary Lists the certificate contacts for a specified key vault. + * + * The GetCertificateContacts operation returns the set of certificate contact + * resources in the specified key vault. This operation requires the + * certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificateContactsWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificateContacts(vaultBaseUrl, 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 the certificate contacts for a specified key vault. + * + * The GetCertificateContacts operation returns the set of certificate contact + * resources in the specified key vault. This operation requires the + * certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Contacts} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateContacts(vaultBaseUrl, 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._getCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificateContacts(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Deletes the certificate contacts for a specified key vault. + * + * Deletes the certificate contacts for a specified key vault certificate. This + * operation requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteCertificateContactsWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteCertificateContacts(vaultBaseUrl, 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 certificate contacts for a specified key vault. + * + * Deletes the certificate contacts for a specified key vault certificate. This + * operation requires the certificates/managecontacts permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Contacts} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteCertificateContacts(vaultBaseUrl, 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._deleteCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteCertificateContacts(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary List certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificateIssuersWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificateIssuers(vaultBaseUrl, 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 certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateIssuerListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateIssuers(vaultBaseUrl, 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._getCertificateIssuers(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificateIssuers(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Sets the specified certificate issuer. + * + * The SetCertificateIssuer operation adds or updates the specified certificate + * issuer. This operation requires the certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {string} provider The issuer provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + setCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, provider, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._setCertificateIssuer(vaultBaseUrl, issuerName, provider, 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 the specified certificate issuer. + * + * The SetCertificateIssuer operation adds or updates the specified certificate + * issuer. This operation requires the certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {string} provider The issuer provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {IssuerBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + setCertificateIssuer(vaultBaseUrl, issuerName, provider, 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._setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, optionalCallback); + } + } + + /** + * @summary Updates the specified certificate issuer. + * + * The UpdateCertificateIssuer operation performs an update on the specified + * certificate issuer entity. This operation requires the + * certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.provider] The issuer provider. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateCertificateIssuer(vaultBaseUrl, issuerName, 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 specified certificate issuer. + * + * The UpdateCertificateIssuer operation performs an update on the specified + * certificate issuer entity. This operation requires the + * certificates/setissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.provider] The issuer provider. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {IssuerBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateCertificateIssuer(vaultBaseUrl, issuerName, 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._updateCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); + } + } + + /** + * @summary Lists the specified certificate issuer. + * + * The GetCertificateIssuer operation returns the specified certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificateIssuer(vaultBaseUrl, issuerName, 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 the specified certificate issuer. + * + * The GetCertificateIssuer operation returns the specified certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {IssuerBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateIssuer(vaultBaseUrl, issuerName, 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._getCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); + } + } + + /** + * @summary Deletes the specified certificate issuer. + * + * The DeleteCertificateIssuer operation permanently removes the specified + * certificate issuer from the vault. This operation requires the + * certificates/manageissuers/deleteissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteCertificateIssuer(vaultBaseUrl, issuerName, 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 specified certificate issuer. + * + * The DeleteCertificateIssuer operation permanently removes the specified + * certificate issuer from the vault. This operation requires the + * certificates/manageissuers/deleteissuers permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {IssuerBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteCertificateIssuer(vaultBaseUrl, issuerName, 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._deleteCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); + } + } + + /** + * @summary Creates a new certificate. + * + * If this is the first version, the certificate resource is created. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._createCertificate(vaultBaseUrl, certificateName, 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 certificate. + * + * If this is the first version, the certificate resource is created. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateOperation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createCertificate(vaultBaseUrl, certificateName, 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._createCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Imports a certificate into a specified key vault. + * + * Imports an existing valid certificate, containing a private key, into Azure + * Key Vault. The certificate to be imported can be in either PFX or PEM + * format. If the certificate is in PEM format the PEM file must contain the + * key as well as x509 certificates. This operation requires the + * certificates/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + importCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, base64EncodedCertificate, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Imports a certificate into a specified key vault. + * + * Imports an existing valid certificate, containing a private key, into Azure + * Key Vault. The certificate to be imported can be in either PFX or PEM + * format. If the certificate is in PEM format the PEM file must contain the + * key as well as x509 certificates. This operation requires the + * certificates/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, 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._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, optionalCallback); + } + } + + /** + * @summary List the versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificateVersionsWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificateVersions(vaultBaseUrl, certificateName, 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 versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateVersions(vaultBaseUrl, certificateName, 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._getCertificateVersions(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificateVersions(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Lists the policy for a certificate. + * + * The GetCertificatePolicy operation returns the specified certificate policy + * resources in the specified key vault. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in a given key + * vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificatePolicyWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificatePolicy(vaultBaseUrl, certificateName, 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 the policy for a certificate. + * + * The GetCertificatePolicy operation returns the specified certificate policy + * resources in the specified key vault. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in a given key + * vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificatePolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificatePolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificatePolicy(vaultBaseUrl, certificateName, 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._getCertificatePolicy(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificatePolicy(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Updates the policy for a certificate. + * + * Set specified members in the certificate policy. Leave others as null. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the + * same key pair will be used on certificate renewal. + * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. + * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC. + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateCertificatePolicyWithHttpOperationResponse(vaultBaseUrl, certificateName, certificatePolicy, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, 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 policy for a certificate. + * + * Set specified members in the certificate policy. Leave others as null. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the + * same key pair will be used on certificate renewal. + * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. + * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC. + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificatePolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificatePolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, 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._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, optionalCallback); + } + } + + /** + * @summary Updates the specified attributes associated with the given + * certificate. + * + * The UpdateCertificate operation applies the specified update on the given + * certificate; the only elements updated are the certificate's attributes. + * This operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given key + * vault. + * + * @param {string} certificateVersion The version of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers 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(vaultBaseUrl, certificateName, certificateVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, 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 specified attributes associated with the given + * certificate. + * + * The UpdateCertificate operation applies the specified update on the given + * certificate; the only elements updated are the certificate's attributes. + * This operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given key + * vault. + * + * @param {string} certificateVersion The version of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {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(vaultBaseUrl, certificateName, certificateVersion, 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._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback); + } + } + + /** + * @summary Gets information about a certificate. + * + * Gets information about a specific certificate. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {string} certificateVersion The version 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(vaultBaseUrl, certificateName, certificateVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificate(vaultBaseUrl, certificateName, certificateVersion, 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 information about a certificate. + * + * Gets information about a specific certificate. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {string} certificateVersion The version 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 {CertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {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(vaultBaseUrl, certificateName, certificateVersion, 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._getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback); + } + } + + /** + * @summary Updates a certificate operation. + * + * Updates a certificate creation operation that is already in progress. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, cancellationRequested, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, 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 certificate operation. + * + * Updates a certificate creation operation that is already in progress. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate 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 {CertificateOperation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, 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._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, optionalCallback); + } + } + + /** + * @summary Gets the creation operation of a certificate. + * + * Gets the creation operation associated with a specified certificate. This + * operation requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + getCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificateOperation(vaultBaseUrl, certificateName, 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 creation operation of a certificate. + * + * Gets the creation operation associated with a specified certificate. This + * operation requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {CertificateOperation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateOperation(vaultBaseUrl, certificateName, 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._getCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Deletes the creation operation for a specific certificate. + * + * Deletes the creation operation for a specified certificate that is in the + * process of being created. The certificate is no longer created. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + deleteCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteCertificateOperation(vaultBaseUrl, certificateName, 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 creation operation for a specific certificate. + * + * Deletes the creation operation for a specified certificate that is in the + * process of being created. The certificate is no longer created. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {CertificateOperation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteCertificateOperation(vaultBaseUrl, certificateName, 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._deleteCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Merges a certificate or a certificate chain with a key pair + * existing on the server. + * + * The MergeCertificate operation performs the merging of a certificate or + * certificate chain with a key pair currently available in the service. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + mergeCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, x509Certificates, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Merges a certificate or a certificate chain with a key pair + * existing on the server. + * + * The MergeCertificate operation performs the merging of a certificate or + * certificate chain with a key pair currently available in the service. This + * operation requires the certificates/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, 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._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, optionalCallback); + } + } + + /** + * @summary Backs up the specified certificate. + * + * Requests that a backup of the specified certificate be downloaded to the + * client. All versions of the certificate will be downloaded. This operation + * requires the certificates/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + backupCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._backupCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Backs up the specified certificate. + * + * Requests that a backup of the specified certificate be downloaded to the + * client. All versions of the certificate will be downloaded. This operation + * requires the certificates/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {BackupCertificateResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupCertificateResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + backupCertificate(vaultBaseUrl, certificateName, 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._backupCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._backupCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Restores a backed up certificate to a vault. + * + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + restoreCertificateWithHttpOperationResponse(vaultBaseUrl, certificateBundleBackup, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._restoreCertificate(vaultBaseUrl, certificateBundleBackup, 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 backed up certificate to a vault. + * + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreCertificate(vaultBaseUrl, certificateBundleBackup, 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._restoreCertificate(vaultBaseUrl, certificateBundleBackup, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreCertificate(vaultBaseUrl, certificateBundleBackup, options, optionalCallback); + } + } + + /** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedCertificatesWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedCertificates(vaultBaseUrl, 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 the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedCertificateListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedCertificates(vaultBaseUrl, 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._getDeletedCertificates(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedCertificates(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Retrieves information about the specified deleted certificate. + * + * The GetDeletedCertificate operation retrieves the deleted certificate + * information plus its attributes, such as retention interval, scheduled + * permanent deletion and the current deletion recovery level. This operation + * requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + getDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedCertificate(vaultBaseUrl, certificateName, 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 information about the specified deleted certificate. + * + * The GetDeletedCertificate operation retrieves the deleted certificate + * information plus its attributes, such as retention interval, scheduled + * permanent deletion and the current deletion recovery level. This operation + * requires the certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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 {DeletedCertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateBundle} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedCertificate(vaultBaseUrl, certificateName, 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._getDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Permanently deletes the specified deleted certificate. + * + * The PurgeDeletedCertificate operation performs an irreversible deletion of + * the specified certificate, without possibility for recovery. The operation + * is not available if the recovery level does not specify 'Purgeable'. This + * operation requires the certificate/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + purgeDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Permanently deletes the specified deleted certificate. + * + * The PurgeDeletedCertificate operation performs an irreversible deletion of + * the specified certificate, without possibility for recovery. The operation + * is not available if the recovery level does not specify 'Purgeable'. This + * operation requires the certificate/purge permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The 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. + */ + purgeDeletedCertificate(vaultBaseUrl, certificateName, 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._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Recovers the deleted certificate back to its current version under + * /certificates. + * + * The RecoverDeletedCertificate operation performs the reversal of the Delete + * operation. The operation is applicable in vaults enabled for soft-delete, + * and must be issued during the retention interval (available in the deleted + * certificate's attributes). This operation requires the certificates/recover + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the deleted 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. + */ + recoverDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Recovers the deleted certificate back to its current version under + * /certificates. + * + * The RecoverDeletedCertificate operation performs the reversal of the Delete + * operation. The operation is applicable in vaults enabled for soft-delete, + * and must be issued during the retention interval (available in the deleted + * certificate's attributes). This operation requires the certificates/recover + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the deleted 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 {CertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedCertificate(vaultBaseUrl, certificateName, 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._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getStorageAccountsWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getStorageAccounts(vaultBaseUrl, 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._getStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getStorageAccounts(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedStorageAccountsWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedStorageAccounts(vaultBaseUrl, 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 deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedStorageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedStorageAccounts(vaultBaseUrl, 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._getDeletedStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedStorageAccounts(vaultBaseUrl, options, optionalCallback); + } + } + + /** + * @summary Gets the specified deleted storage account. + * + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedStorageAccount(vaultBaseUrl, storageAccountName, 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 specified deleted storage account. + * + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedStorageBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedStorageAccount(vaultBaseUrl, storageAccountName, 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._getDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * @summary Permanently deletes the specified storage account. + * + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + purgeDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Permanently deletes the specified storage account. + * + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, 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._purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * @summary Recovers the deleted storage account. + * + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + recoverDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Recovers the deleted storage account. + * + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, 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._recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * @summary Backs up the specified storage account. + * + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + backupStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._backupStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Backs up the specified storage account. + * + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BackupStorageResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupStorageResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + backupStorageAccount(vaultBaseUrl, storageAccountName, 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._backupStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._backupStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * @summary Restores a backed up storage account to a vault. + * + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + restoreStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageBundleBackup, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._restoreStorageAccount(vaultBaseUrl, storageBundleBackup, 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 backed up storage account to a vault. + * + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreStorageAccount(vaultBaseUrl, storageBundleBackup, 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._restoreStorageAccount(vaultBaseUrl, storageBundleBackup, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreStorageAccount(vaultBaseUrl, storageBundleBackup, options, optionalCallback); + } + } + + /** + * Deletes a storage account. This operation requires the storage/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a storage account. This operation requires the storage/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedStorageBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteStorageAccount(vaultBaseUrl, storageAccountName, 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._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * Gets information about a specified storage account. This operation requires + * the storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about a specified storage account. This operation requires + * the storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getStorageAccount(vaultBaseUrl, storageAccountName, 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._getStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * Creates or updates a new storage account. This operation requires the + * storage/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + setStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a new storage account. This operation requires the + * storage/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, 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._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, optionalCallback); + } + } + + /** + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateStorageAccount(vaultBaseUrl, storageAccountName, 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._updateStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} keyName The storage account key 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. + */ + regenerateStorageAccountKeyWithHttpOperationResponse(vaultBaseUrl, storageAccountName, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} keyName The storage account key 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 {StorageBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, 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._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, optionalCallback); + } + } + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSasDefinitionsWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SasDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSasDefinitions(vaultBaseUrl, storageAccountName, 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._getSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSasDefinitions(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedSasDefinitionsWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, 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 deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedSasDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, 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._getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, options, optionalCallback); + } + } + + /** + * @summary Gets the specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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 specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedSasDefinitionBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionBundle} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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._getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback); + } + } + + /** + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + recoverDeletedSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SasDefinitionBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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._recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback); + } + } + + /** + * Deletes a SAS definition from a specified storage account. This operation + * requires the storage/deletesas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a SAS definition from a specified storage account. This operation + * requires the storage/deletesas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedSasDefinitionBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionBundle} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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._deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback); + } + } + + /** + * Gets information about a SAS definition for the specified storage account. + * This operation requires the storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about a SAS definition for the specified storage account. + * This operation requires the storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SasDefinitionBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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._getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback); + } + } + + /** + * Creates or updates a new SAS definition for the specified storage account. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + setSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a new SAS definition for the specified storage account. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SasDefinitionBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, 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._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options, optionalCallback); + } + } + + /** + * Updates the specified attributes associated with the given SAS definition. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the specified attributes associated with the given SAS definition. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SasDefinitionBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, 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._updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback); + } + } + + /** + * @summary Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getKeyVersionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getKeyVersionsNext(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 Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {KeyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getKeyVersionsNext(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._getKeyVersionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getKeyVersionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getKeysNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getKeysNext(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 keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {KeyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getKeysNext(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._getKeysNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getKeysNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedKeysNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedKeysNext(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 the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {DeletedKeyListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedKeysNext(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._getDeletedKeysNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedKeysNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSecretsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSecretsNext(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 secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {SecretListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSecretsNext(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._getSecretsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSecretsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List all versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSecretVersionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSecretVersionsNext(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 versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {SecretListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSecretVersionsNext(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._getSecretVersionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSecretVersionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedSecretsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedSecretsNext(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 deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {DeletedSecretListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSecretsNext(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._getDeletedSecretsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedSecretsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificatesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificatesNext(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 certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {CertificateListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificatesNext(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._getCertificatesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificatesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificateIssuersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificateIssuersNext(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 certificate issuers for a specified key vault. + * + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {CertificateIssuerListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateIssuersNext(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._getCertificateIssuersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificateIssuersNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificateVersionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificateVersionsNext(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 versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {CertificateListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getCertificateVersionsNext(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._getCertificateVersionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificateVersionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedCertificatesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedCertificatesNext(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 the deleted certificates in the specified vault currently + * available for recovery. + * + * The GetDeletedCertificates operation retrieves the certificates in the + * current vault which are in a deleted state and ready for recovery or + * purging. This operation includes deletion-specific information. This + * operation requires the certificates/get/list permission. This operation can + * only be enabled on soft-delete enabled vaults. + * + * @param {string} nextPageLink The NextLink from the previous 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 {DeletedCertificateListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedCertificatesNext(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._getDeletedCertificatesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedCertificatesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getStorageAccountsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getStorageAccountsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {StorageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getStorageAccountsNext(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._getStorageAccountsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getStorageAccountsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedStorageAccountsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedStorageAccountsNext(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 deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {DeletedStorageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedStorageAccountsNext(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._getDeletedStorageAccountsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedStorageAccountsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSasDefinitionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSasDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {SasDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSasDefinitionsNext(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._getSasDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSasDefinitionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedSasDefinitionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedSasDefinitionsNext(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 deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous 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 {DeletedSasDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinitionsNext(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._getDeletedSasDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedSasDefinitionsNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = KeyVaultClient; +module.exports['default'] = KeyVaultClient; +module.exports.KeyVaultClient = KeyVaultClient; +module.exports.KeyVaultModels = models; diff --git a/lib/services/keyvault/lib/models/action.js b/lib/services/keyvault/lib/models/action.js new file mode 100644 index 0000000000..d24f32fa33 --- /dev/null +++ b/lib/services/keyvault/lib/models/action.js @@ -0,0 +1,54 @@ +/* + * 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 action that will be executed. + * + */ +class Action { + /** + * Create a Action. + * @member {string} [actionType] The type of the action. Possible values + * include: 'EmailContacts', 'AutoRenew' + */ + constructor() { + } + + /** + * Defines the metadata of Action + * + * @returns {object} metadata of Action + * + */ + mapper() { + return { + required: false, + serializedName: 'Action', + type: { + name: 'Composite', + className: 'Action', + modelProperties: { + actionType: { + required: false, + serializedName: 'action_type', + type: { + name: 'Enum', + allowedValues: [ 'EmailContacts', 'AutoRenew' ] + } + } + } + } + }; + } +} + +module.exports = Action; diff --git a/lib/services/keyvault/lib/models/administratorDetails.js b/lib/services/keyvault/lib/models/administratorDetails.js new file mode 100644 index 0000000000..3119ec698f --- /dev/null +++ b/lib/services/keyvault/lib/models/administratorDetails.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'; + +/** + * Details of the organization administrator of the certificate issuer. + * + */ +class AdministratorDetails { + /** + * Create a AdministratorDetails. + * @member {string} [firstName] First name. + * @member {string} [lastName] Last name. + * @member {string} [emailAddress] Email addresss. + * @member {string} [phone] Phone number. + */ + constructor() { + } + + /** + * Defines the metadata of AdministratorDetails + * + * @returns {object} metadata of AdministratorDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'AdministratorDetails', + type: { + name: 'Composite', + className: 'AdministratorDetails', + modelProperties: { + firstName: { + required: false, + serializedName: 'first_name', + type: { + name: 'String' + } + }, + lastName: { + required: false, + serializedName: 'last_name', + type: { + name: 'String' + } + }, + emailAddress: { + required: false, + serializedName: 'email', + type: { + name: 'String' + } + }, + phone: { + required: false, + serializedName: 'phone', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdministratorDetails; diff --git a/lib/services/keyvault/lib/models/attributes.js b/lib/services/keyvault/lib/models/attributes.js new file mode 100644 index 0000000000..200b41fd22 --- /dev/null +++ b/lib/services/keyvault/lib/models/attributes.js @@ -0,0 +1,86 @@ +/* + * 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 object attributes managed by the KeyVault service. + * + */ +class Attributes { + /** + * Create a Attributes. + * @member {boolean} [enabled] Determines whether the object is enabled. + * @member {date} [notBefore] Not before date in UTC. + * @member {date} [expires] Expiry date in UTC. + * @member {date} [created] Creation time in UTC. + * @member {date} [updated] Last updated time in UTC. + */ + constructor() { + } + + /** + * Defines the metadata of Attributes + * + * @returns {object} metadata of Attributes + * + */ + mapper() { + return { + required: false, + serializedName: 'Attributes', + type: { + name: 'Composite', + className: 'Attributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + notBefore: { + required: false, + serializedName: 'nbf', + type: { + name: 'UnixTime' + } + }, + expires: { + required: false, + serializedName: 'exp', + type: { + name: 'UnixTime' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = Attributes; diff --git a/lib/services/keyvault/lib/models/backupCertificateResult.js b/lib/services/keyvault/lib/models/backupCertificateResult.js new file mode 100644 index 0000000000..6d4205ce72 --- /dev/null +++ b/lib/services/keyvault/lib/models/backupCertificateResult.js @@ -0,0 +1,54 @@ +/* + * 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 backup certificate result, containing the backup blob. + * + */ +class BackupCertificateResult { + /** + * Create a BackupCertificateResult. + * @member {buffer} [value] The backup blob containing the backed up + * certificate. + */ + constructor() { + } + + /** + * Defines the metadata of BackupCertificateResult + * + * @returns {object} metadata of BackupCertificateResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupCertificateResult', + type: { + name: 'Composite', + className: 'BackupCertificateResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = BackupCertificateResult; diff --git a/lib/services/keyvault/lib/models/backupKeyResult.js b/lib/services/keyvault/lib/models/backupKeyResult.js new file mode 100644 index 0000000000..b3ee68e5fb --- /dev/null +++ b/lib/services/keyvault/lib/models/backupKeyResult.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The backup key result, containing the backup blob. + * + */ +class BackupKeyResult { + /** + * Create a BackupKeyResult. + * @member {buffer} [value] The backup blob containing the backed up key. + */ + constructor() { + } + + /** + * Defines the metadata of BackupKeyResult + * + * @returns {object} metadata of BackupKeyResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupKeyResult', + type: { + name: 'Composite', + className: 'BackupKeyResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = BackupKeyResult; diff --git a/lib/services/keyvault/lib/models/backupSecretResult.js b/lib/services/keyvault/lib/models/backupSecretResult.js new file mode 100644 index 0000000000..21b4a3c132 --- /dev/null +++ b/lib/services/keyvault/lib/models/backupSecretResult.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The backup secret result, containing the backup blob. + * + */ +class BackupSecretResult { + /** + * Create a BackupSecretResult. + * @member {buffer} [value] The backup blob containing the backed up secret. + */ + constructor() { + } + + /** + * Defines the metadata of BackupSecretResult + * + * @returns {object} metadata of BackupSecretResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupSecretResult', + type: { + name: 'Composite', + className: 'BackupSecretResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = BackupSecretResult; diff --git a/lib/services/keyvault/lib/models/backupStorageResult.js b/lib/services/keyvault/lib/models/backupStorageResult.js new file mode 100644 index 0000000000..c39af99c8c --- /dev/null +++ b/lib/services/keyvault/lib/models/backupStorageResult.js @@ -0,0 +1,54 @@ +/* + * 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 backup storage result, containing the backup blob. + * + */ +class BackupStorageResult { + /** + * Create a BackupStorageResult. + * @member {buffer} [value] The backup blob containing the backed up storage + * account. + */ + constructor() { + } + + /** + * Defines the metadata of BackupStorageResult + * + * @returns {object} metadata of BackupStorageResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupStorageResult', + type: { + name: 'Composite', + className: 'BackupStorageResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = BackupStorageResult; diff --git a/lib/services/keyvault/lib/models/certificateAttributes.js b/lib/services/keyvault/lib/models/certificateAttributes.js new file mode 100644 index 0000000000..58468fdeca --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateAttributes.js @@ -0,0 +1,101 @@ +/* + * 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 certificate management attributes. + * + * @extends models['Attributes'] + */ +class CertificateAttributes extends models['Attributes'] { + /** + * Create a CertificateAttributes. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for certificates in the current vault. If it contains + * 'Purgeable', the certificate can be permanently deleted by a privileged + * user; otherwise, only the system can purge the certificate, at the end of + * the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CertificateAttributes + * + * @returns {object} metadata of CertificateAttributes + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateAttributes', + type: { + name: 'Composite', + className: 'CertificateAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + notBefore: { + required: false, + serializedName: 'nbf', + type: { + name: 'UnixTime' + } + }, + expires: { + required: false, + serializedName: 'exp', + type: { + name: 'UnixTime' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + }, + recoveryLevel: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'recoveryLevel', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificateAttributes; diff --git a/lib/services/keyvault/lib/models/certificateBundle.js b/lib/services/keyvault/lib/models/certificateBundle.js new file mode 100644 index 0000000000..39982e8694 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateBundle.js @@ -0,0 +1,198 @@ +/* + * 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'; + +/** + * A certificate bundle consists of a certificate (X509) plus its attributes. + * + */ +class CertificateBundle { + /** + * Create a CertificateBundle. + * @member {string} [id] The certificate id. + * @member {string} [kid] The key id. + * @member {string} [sid] The secret id. + * @member {buffer} [x509Thumbprint] Thumbprint of the certificate. + * @member {object} [policy] The management policy. + * @member {string} [policy.id] The certificate id. + * @member {object} [policy.keyProperties] Properties of the key backing a + * certificate. + * @member {boolean} [policy.keyProperties.exportable] Indicates if the + * private key can be exported. + * @member {string} [policy.keyProperties.keyType] The type of key pair to be + * used for the certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', + * 'RSA-HSM', 'oct' + * @member {number} [policy.keyProperties.keySize] The key size in bits. For + * example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [policy.keyProperties.reuseKey] Indicates if the same + * key pair will be used on certificate renewal. + * @member {string} [policy.keyProperties.curve] Elliptic curve name. For + * valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * @member {object} [policy.secretProperties] Properties of the secret + * backing a certificate. + * @member {string} [policy.secretProperties.contentType] The media type + * (MIME type). + * @member {object} [policy.x509CertificateProperties] Properties of the X509 + * component of a certificate. + * @member {string} [policy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * @member {array} [policy.x509CertificateProperties.ekus] The enhanced key + * usage. + * @member {object} + * [policy.x509CertificateProperties.subjectAlternativeNames] The subject + * alternative names. + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.emails] Email + * addresses. + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.dnsNames] Domain + * names. + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.upns] User + * principal names. + * @member {array} [policy.x509CertificateProperties.keyUsage] List of key + * usages. + * @member {number} [policy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * @member {array} [policy.lifetimeActions] Actions that will be performed by + * Key Vault over the lifetime of a certificate. + * @member {object} [policy.issuerParameters] Parameters for the issuer of + * the X509 component of a certificate. + * @member {string} [policy.issuerParameters.name] Name of the referenced + * issuer object or reserved names; for example, 'Self' or 'Unknown'. + * @member {string} [policy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. + * @member {boolean} [policy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * @member {object} [policy.attributes] The certificate attributes. + * @member {string} [policy.attributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for certificates in the current vault. + * If it contains 'Purgeable', the certificate can be permanently deleted by + * a privileged user; otherwise, only the system can purge the certificate, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {buffer} [cer] CER contents of x509 certificate. + * @member {string} [contentType] The content type of the secret. + * @member {object} [attributes] The certificate attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for certificates in the current vault. If it + * contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs + */ + constructor() { + } + + /** + * Defines the metadata of CertificateBundle + * + * @returns {object} metadata of CertificateBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateBundle', + type: { + name: 'Composite', + className: 'CertificateBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + kid: { + required: false, + readOnly: true, + serializedName: 'kid', + type: { + name: 'String' + } + }, + sid: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + x509Thumbprint: { + required: false, + readOnly: true, + serializedName: 'x5t', + type: { + name: 'Base64Url' + } + }, + policy: { + required: false, + readOnly: true, + serializedName: 'policy', + type: { + name: 'Composite', + className: 'CertificatePolicy' + } + }, + cer: { + required: false, + serializedName: 'cer', + type: { + name: 'ByteArray' + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CertificateBundle; diff --git a/lib/services/keyvault/lib/models/certificateCreateParameters.js b/lib/services/keyvault/lib/models/certificateCreateParameters.js new file mode 100644 index 0000000000..bdcc2e13e2 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateCreateParameters.js @@ -0,0 +1,151 @@ +/* + * 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 certificate create parameters. + * + */ +class CertificateCreateParameters { + /** + * Create a CertificateCreateParameters. + * @member {object} [certificatePolicy] The management policy for the + * certificate. + * @member {string} [certificatePolicy.id] The certificate id. + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates + * if the private key can be exported. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * @member {string} [certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * @member {object} [certificatePolicy.x509CertificateProperties] Properties + * of the X509 component of a certificate. + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] + * List of key usages. + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * @member {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * @member {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * @member {string} [certificatePolicy.issuerParameters.certificateType] Type + * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {object} [certificatePolicy.attributes] The certificate + * attributes. + * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the + * current vault. If it contains 'Purgeable', the certificate can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the certificate, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional). + * @member {string} [certificateAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the + * current vault. If it contains 'Purgeable', the certificate can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the certificate, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateCreateParameters + * + * @returns {object} metadata of CertificateCreateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateCreateParameters', + type: { + name: 'Composite', + className: 'CertificateCreateParameters', + modelProperties: { + certificatePolicy: { + required: false, + serializedName: 'policy', + type: { + name: 'Composite', + className: 'CertificatePolicy' + } + }, + certificateAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CertificateCreateParameters; diff --git a/lib/services/keyvault/lib/models/certificateImportParameters.js b/lib/services/keyvault/lib/models/certificateImportParameters.js new file mode 100644 index 0000000000..2b34a42fef --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateImportParameters.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'; + +/** + * The certificate import parameters. + * + */ +class CertificateImportParameters { + /** + * Create a CertificateImportParameters. + * @member {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * @member {string} [password] If the private key in base64EncodedCertificate + * is encrypted, the password used for encryption. + * @member {object} [certificatePolicy] The management policy for the + * certificate. + * @member {string} [certificatePolicy.id] The certificate id. + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates + * if the private key can be exported. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * @member {string} [certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * @member {object} [certificatePolicy.x509CertificateProperties] Properties + * of the X509 component of a certificate. + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] + * List of key usages. + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * @member {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * @member {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * @member {string} [certificatePolicy.issuerParameters.certificateType] Type + * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {object} [certificatePolicy.attributes] The certificate + * attributes. + * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the + * current vault. If it contains 'Purgeable', the certificate can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the certificate, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional). + * @member {string} [certificateAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the + * current vault. If it contains 'Purgeable', the certificate can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the certificate, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateImportParameters + * + * @returns {object} metadata of CertificateImportParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateImportParameters', + type: { + name: 'Composite', + className: 'CertificateImportParameters', + modelProperties: { + base64EncodedCertificate: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'pwd', + type: { + name: 'String' + } + }, + certificatePolicy: { + required: false, + serializedName: 'policy', + type: { + name: 'Composite', + className: 'CertificatePolicy' + } + }, + certificateAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CertificateImportParameters; diff --git a/lib/services/keyvault/lib/models/certificateIssuerItem.js b/lib/services/keyvault/lib/models/certificateIssuerItem.js new file mode 100644 index 0000000000..a21aebf800 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateIssuerItem.js @@ -0,0 +1,60 @@ +/* + * 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 certificate issuer item containing certificate issuer metadata. + * + */ +class CertificateIssuerItem { + /** + * Create a CertificateIssuerItem. + * @member {string} [id] Certificate Identifier. + * @member {string} [provider] The issuer provider. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateIssuerItem + * + * @returns {object} metadata of CertificateIssuerItem + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateIssuerItem', + type: { + name: 'Composite', + className: 'CertificateIssuerItem', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificateIssuerItem; diff --git a/lib/services/keyvault/lib/models/certificateIssuerListResult.js b/lib/services/keyvault/lib/models/certificateIssuerListResult.js new file mode 100644 index 0000000000..7c94a3a356 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateIssuerListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The certificate issuer list result. + */ +class CertificateIssuerListResult extends Array { + /** + * Create a CertificateIssuerListResult. + * @member {string} [nextLink] The URL to get the next set of certificate + * issuers. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CertificateIssuerListResult + * + * @returns {object} metadata of CertificateIssuerListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateIssuerListResult', + type: { + name: 'Composite', + className: 'CertificateIssuerListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CertificateIssuerItemElementType', + type: { + name: 'Composite', + className: 'CertificateIssuerItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificateIssuerListResult; diff --git a/lib/services/keyvault/lib/models/certificateIssuerSetParameters.js b/lib/services/keyvault/lib/models/certificateIssuerSetParameters.js new file mode 100644 index 0000000000..60bd0dd08f --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateIssuerSetParameters.js @@ -0,0 +1,90 @@ +/* + * 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 certificate issuer set parameters. + * + */ +class CertificateIssuerSetParameters { + /** + * Create a CertificateIssuerSetParameters. + * @member {string} provider The issuer provider. + * @member {object} [credentials] The credentials to be used for the issuer. + * @member {string} [credentials.accountId] The user name/account + * name/account id. + * @member {string} [credentials.password] The password/secret/account key. + * @member {object} [organizationDetails] Details of the organization as + * provided to the issuer. + * @member {string} [organizationDetails.id] Id of the organization. + * @member {array} [organizationDetails.adminDetails] Details of the + * organization administrator. + * @member {object} [attributes] Attributes of the issuer object. + * @member {boolean} [attributes.enabled] Determines whether the issuer is + * enabled. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateIssuerSetParameters + * + * @returns {object} metadata of CertificateIssuerSetParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateIssuerSetParameters', + type: { + name: 'Composite', + className: 'CertificateIssuerSetParameters', + modelProperties: { + provider: { + required: true, + serializedName: 'provider', + type: { + name: 'String' + } + }, + credentials: { + required: false, + serializedName: 'credentials', + type: { + name: 'Composite', + className: 'IssuerCredentials' + } + }, + organizationDetails: { + required: false, + serializedName: 'org_details', + type: { + name: 'Composite', + className: 'OrganizationDetails' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'IssuerAttributes' + } + } + } + } + }; + } +} + +module.exports = CertificateIssuerSetParameters; diff --git a/lib/services/keyvault/lib/models/certificateIssuerUpdateParameters.js b/lib/services/keyvault/lib/models/certificateIssuerUpdateParameters.js new file mode 100644 index 0000000000..8e023bb2ae --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateIssuerUpdateParameters.js @@ -0,0 +1,90 @@ +/* + * 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 certificate issuer update parameters. + * + */ +class CertificateIssuerUpdateParameters { + /** + * Create a CertificateIssuerUpdateParameters. + * @member {string} [provider] The issuer provider. + * @member {object} [credentials] The credentials to be used for the issuer. + * @member {string} [credentials.accountId] The user name/account + * name/account id. + * @member {string} [credentials.password] The password/secret/account key. + * @member {object} [organizationDetails] Details of the organization as + * provided to the issuer. + * @member {string} [organizationDetails.id] Id of the organization. + * @member {array} [organizationDetails.adminDetails] Details of the + * organization administrator. + * @member {object} [attributes] Attributes of the issuer object. + * @member {boolean} [attributes.enabled] Determines whether the issuer is + * enabled. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateIssuerUpdateParameters + * + * @returns {object} metadata of CertificateIssuerUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateIssuerUpdateParameters', + type: { + name: 'Composite', + className: 'CertificateIssuerUpdateParameters', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + credentials: { + required: false, + serializedName: 'credentials', + type: { + name: 'Composite', + className: 'IssuerCredentials' + } + }, + organizationDetails: { + required: false, + serializedName: 'org_details', + type: { + name: 'Composite', + className: 'OrganizationDetails' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'IssuerAttributes' + } + } + } + } + }; + } +} + +module.exports = CertificateIssuerUpdateParameters; diff --git a/lib/services/keyvault/lib/models/certificateItem.js b/lib/services/keyvault/lib/models/certificateItem.js new file mode 100644 index 0000000000..9938da2a17 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateItem.js @@ -0,0 +1,92 @@ +/* + * 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 certificate item containing certificate metadata. + * + */ +class CertificateItem { + /** + * Create a CertificateItem. + * @member {string} [id] Certificate identifier. + * @member {object} [attributes] The certificate management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for certificates in the current vault. If it + * contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {buffer} [x509Thumbprint] Thumbprint of the certificate. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateItem + * + * @returns {object} metadata of CertificateItem + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateItem', + type: { + name: 'Composite', + className: 'CertificateItem', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + x509Thumbprint: { + required: false, + serializedName: 'x5t', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = CertificateItem; diff --git a/lib/services/keyvault/lib/models/certificateListResult.js b/lib/services/keyvault/lib/models/certificateListResult.js new file mode 100644 index 0000000000..1745fba2cb --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateListResult.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'; + +/** + * The certificate list result. + */ +class CertificateListResult extends Array { + /** + * Create a CertificateListResult. + * @member {string} [nextLink] The URL to get the next set of certificates. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CertificateListResult + * + * @returns {object} metadata of CertificateListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateListResult', + type: { + name: 'Composite', + className: 'CertificateListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CertificateItemElementType', + type: { + name: 'Composite', + className: 'CertificateItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificateListResult; diff --git a/lib/services/keyvault/lib/models/certificateMergeParameters.js b/lib/services/keyvault/lib/models/certificateMergeParameters.js new file mode 100644 index 0000000000..b00a0857ff --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateMergeParameters.js @@ -0,0 +1,93 @@ +/* + * 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 certificate merge parameters + * + */ +class CertificateMergeParameters { + /** + * Create a CertificateMergeParameters. + * @member {array} x509Certificates The certificate or the certificate chain + * to merge. + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional). + * @member {string} [certificateAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the + * current vault. If it contains 'Purgeable', the certificate can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the certificate, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateMergeParameters + * + * @returns {object} metadata of CertificateMergeParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateMergeParameters', + type: { + name: 'Composite', + className: 'CertificateMergeParameters', + modelProperties: { + x509Certificates: { + required: true, + serializedName: 'x5c', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BufferElementType', + type: { + name: 'ByteArray' + } + } + } + }, + certificateAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CertificateMergeParameters; diff --git a/lib/services/keyvault/lib/models/certificateOperation.js b/lib/services/keyvault/lib/models/certificateOperation.js new file mode 100644 index 0000000000..1e4310493e --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateOperation.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'; + +/** + * A certificate operation is returned in case of asynchronous requests. + * + */ +class CertificateOperation { + /** + * Create a CertificateOperation. + * @member {string} [id] The certificate id. + * @member {object} [issuerParameters] Parameters for the issuer of the X509 + * component of a certificate. + * @member {string} [issuerParameters.name] Name of the referenced issuer + * object or reserved names; for example, 'Self' or 'Unknown'. + * @member {string} [issuerParameters.certificateType] Type of certificate to + * be requested from the issuer provider. + * @member {boolean} [issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {buffer} [csr] The certificate signing request (CSR) that is being + * used in the certificate operation. + * @member {boolean} [cancellationRequested] Indicates if cancellation was + * requested on the certificate operation. + * @member {string} [status] Status of the certificate operation. + * @member {string} [statusDetails] The status details of the certificate + * operation. + * @member {object} [error] Error encountered, if any, during the certificate + * operation. + * @member {string} [error.code] The error code. + * @member {string} [error.message] The error message. + * @member {object} [error.innerError] + * @member {string} [target] Location which contains the result of the + * certificate operation. + * @member {string} [requestId] Identifier for the certificate operation. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateOperation + * + * @returns {object} metadata of CertificateOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateOperation', + type: { + name: 'Composite', + className: 'CertificateOperation', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + issuerParameters: { + required: false, + serializedName: 'issuer', + type: { + name: 'Composite', + className: 'IssuerParameters' + } + }, + csr: { + required: false, + serializedName: 'csr', + type: { + name: 'ByteArray' + } + }, + cancellationRequested: { + required: false, + serializedName: 'cancellation_requested', + type: { + name: 'Boolean' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + serializedName: 'status_details', + type: { + name: 'String' + } + }, + error: { + required: false, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ErrorModel' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + requestId: { + required: false, + serializedName: 'request_id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificateOperation; diff --git a/lib/services/keyvault/lib/models/certificateOperationUpdateParameter.js b/lib/services/keyvault/lib/models/certificateOperationUpdateParameter.js new file mode 100644 index 0000000000..f256ea8ad4 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateOperationUpdateParameter.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The certificate operation update parameters. + * + */ +class CertificateOperationUpdateParameter { + /** + * Create a CertificateOperationUpdateParameter. + * @member {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate operation. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateOperationUpdateParameter + * + * @returns {object} metadata of CertificateOperationUpdateParameter + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateOperationUpdateParameter', + type: { + name: 'Composite', + className: 'CertificateOperationUpdateParameter', + modelProperties: { + cancellationRequested: { + required: true, + serializedName: 'cancellation_requested', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = CertificateOperationUpdateParameter; diff --git a/lib/services/keyvault/lib/models/certificatePolicy.js b/lib/services/keyvault/lib/models/certificatePolicy.js new file mode 100644 index 0000000000..a0d2e00b94 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificatePolicy.js @@ -0,0 +1,161 @@ +/* + * 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'; + +/** + * Management policy for a certificate. + * + */ +class CertificatePolicy { + /** + * Create a CertificatePolicy. + * @member {string} [id] The certificate id. + * @member {object} [keyProperties] Properties of the key backing a + * certificate. + * @member {boolean} [keyProperties.exportable] Indicates if the private key + * can be exported. + * @member {string} [keyProperties.keyType] The type of key pair to be used + * for the certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', + * 'RSA-HSM', 'oct' + * @member {number} [keyProperties.keySize] The key size in bits. For + * example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [keyProperties.reuseKey] Indicates if the same key pair + * will be used on certificate renewal. + * @member {string} [keyProperties.curve] Elliptic curve name. For valid + * values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * @member {object} [secretProperties] Properties of the secret backing a + * certificate. + * @member {string} [secretProperties.contentType] The media type (MIME + * type). + * @member {object} [x509CertificateProperties] Properties of the X509 + * component of a certificate. + * @member {string} [x509CertificateProperties.subject] The subject name. + * Should be a valid X509 distinguished Name. + * @member {array} [x509CertificateProperties.ekus] The enhanced key usage. + * @member {object} [x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * @member {array} [x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * @member {array} + * [x509CertificateProperties.subjectAlternativeNames.dnsNames] Domain names. + * @member {array} [x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * @member {array} [x509CertificateProperties.keyUsage] List of key usages. + * @member {number} [x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * @member {array} [lifetimeActions] Actions that will be performed by Key + * Vault over the lifetime of a certificate. + * @member {object} [issuerParameters] Parameters for the issuer of the X509 + * component of a certificate. + * @member {string} [issuerParameters.name] Name of the referenced issuer + * object or reserved names; for example, 'Self' or 'Unknown'. + * @member {string} [issuerParameters.certificateType] Type of certificate to + * be requested from the issuer provider. + * @member {boolean} [issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {object} [attributes] The certificate attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for certificates in the current vault. If it + * contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + */ + constructor() { + } + + /** + * Defines the metadata of CertificatePolicy + * + * @returns {object} metadata of CertificatePolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificatePolicy', + type: { + name: 'Composite', + className: 'CertificatePolicy', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + keyProperties: { + required: false, + serializedName: 'key_props', + type: { + name: 'Composite', + className: 'KeyProperties' + } + }, + secretProperties: { + required: false, + serializedName: 'secret_props', + type: { + name: 'Composite', + className: 'SecretProperties' + } + }, + x509CertificateProperties: { + required: false, + serializedName: 'x509_props', + type: { + name: 'Composite', + className: 'X509CertificateProperties' + } + }, + lifetimeActions: { + required: false, + serializedName: 'lifetime_actions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LifetimeActionElementType', + type: { + name: 'Composite', + className: 'LifetimeAction' + } + } + } + }, + issuerParameters: { + required: false, + serializedName: 'issuer', + type: { + name: 'Composite', + className: 'IssuerParameters' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + } + } + } + }; + } +} + +module.exports = CertificatePolicy; diff --git a/lib/services/keyvault/lib/models/certificateRestoreParameters.js b/lib/services/keyvault/lib/models/certificateRestoreParameters.js new file mode 100644 index 0000000000..01e1073478 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateRestoreParameters.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The certificate restore parameters. + * + */ +class CertificateRestoreParameters { + /** + * Create a CertificateRestoreParameters. + * @member {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateRestoreParameters + * + * @returns {object} metadata of CertificateRestoreParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateRestoreParameters', + type: { + name: 'Composite', + className: 'CertificateRestoreParameters', + modelProperties: { + certificateBundleBackup: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = CertificateRestoreParameters; diff --git a/lib/services/keyvault/lib/models/certificateUpdateParameters.js b/lib/services/keyvault/lib/models/certificateUpdateParameters.js new file mode 100644 index 0000000000..531b6e2d4f --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateUpdateParameters.js @@ -0,0 +1,151 @@ +/* + * 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 certificate update parameters. + * + */ +class CertificateUpdateParameters { + /** + * Create a CertificateUpdateParameters. + * @member {object} [certificatePolicy] The management policy for the + * certificate. + * @member {string} [certificatePolicy.id] The certificate id. + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates + * if the private key can be exported. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * @member {string} [certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * @member {object} [certificatePolicy.x509CertificateProperties] Properties + * of the X509 component of a certificate. + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] + * List of key usages. + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * @member {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * @member {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * @member {string} [certificatePolicy.issuerParameters.certificateType] Type + * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {object} [certificatePolicy.attributes] The certificate + * attributes. + * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the + * current vault. If it contains 'Purgeable', the certificate can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the certificate, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional). + * @member {string} [certificateAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the + * current vault. If it contains 'Purgeable', the certificate can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the certificate, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateUpdateParameters + * + * @returns {object} metadata of CertificateUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateUpdateParameters', + type: { + name: 'Composite', + className: 'CertificateUpdateParameters', + modelProperties: { + certificatePolicy: { + required: false, + serializedName: 'policy', + type: { + name: 'Composite', + className: 'CertificatePolicy' + } + }, + certificateAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CertificateUpdateParameters; diff --git a/lib/services/keyvault/lib/models/contact.js b/lib/services/keyvault/lib/models/contact.js new file mode 100644 index 0000000000..ab77ce96ab --- /dev/null +++ b/lib/services/keyvault/lib/models/contact.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'; + +/** + * The contact information for the vault certificates. + * + */ +class Contact { + /** + * Create a Contact. + * @member {string} [emailAddress] Email addresss. + * @member {string} [name] Name. + * @member {string} [phone] Phone number. + */ + constructor() { + } + + /** + * Defines the metadata of Contact + * + * @returns {object} metadata of Contact + * + */ + mapper() { + return { + required: false, + serializedName: 'Contact', + type: { + name: 'Composite', + className: 'Contact', + modelProperties: { + emailAddress: { + required: false, + serializedName: 'email', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + phone: { + required: false, + serializedName: 'phone', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Contact; diff --git a/lib/services/keyvault/lib/models/contacts.js b/lib/services/keyvault/lib/models/contacts.js new file mode 100644 index 0000000000..3e33dacabc --- /dev/null +++ b/lib/services/keyvault/lib/models/contacts.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'; + +/** + * The contacts for the vault certificates. + * + */ +class Contacts { + /** + * Create a Contacts. + * @member {string} [id] Identifier for the contacts collection. + * @member {array} [contactList] The contact list for the vault certificates. + */ + constructor() { + } + + /** + * Defines the metadata of Contacts + * + * @returns {object} metadata of Contacts + * + */ + mapper() { + return { + required: false, + serializedName: 'Contacts', + type: { + name: 'Composite', + className: 'Contacts', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + contactList: { + required: false, + serializedName: 'contacts', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContactElementType', + type: { + name: 'Composite', + className: 'Contact' + } + } + } + } + } + } + }; + } +} + +module.exports = Contacts; diff --git a/lib/services/keyvault/lib/models/deletedCertificateBundle.js b/lib/services/keyvault/lib/models/deletedCertificateBundle.js new file mode 100644 index 0000000000..c08fee2dff --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedCertificateBundle.js @@ -0,0 +1,155 @@ +/* + * 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 Certificate consisting of its previous id, attributes and its + * tags, as well as information on when it will be purged. + * + * @extends models['CertificateBundle'] + */ +class DeletedCertificateBundle extends models['CertificateBundle'] { + /** + * Create a DeletedCertificateBundle. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted certificate. + * @member {date} [scheduledPurgeDate] The time when the certificate is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the certificate was deleted, in + * UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedCertificateBundle + * + * @returns {object} metadata of DeletedCertificateBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedCertificateBundle', + type: { + name: 'Composite', + className: 'DeletedCertificateBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + kid: { + required: false, + readOnly: true, + serializedName: 'kid', + type: { + name: 'String' + } + }, + sid: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + x509Thumbprint: { + required: false, + readOnly: true, + serializedName: 'x5t', + type: { + name: 'Base64Url' + } + }, + policy: { + required: false, + readOnly: true, + serializedName: 'policy', + type: { + name: 'Composite', + className: 'CertificatePolicy' + } + }, + cer: { + required: false, + serializedName: 'cer', + type: { + name: 'ByteArray' + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedCertificateBundle; diff --git a/lib/services/keyvault/lib/models/deletedCertificateItem.js b/lib/services/keyvault/lib/models/deletedCertificateItem.js new file mode 100644 index 0000000000..ab66df97f6 --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedCertificateItem.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'); + +/** + * The deleted certificate item containing metadata about the deleted + * certificate. + * + * @extends models['CertificateItem'] + */ +class DeletedCertificateItem extends models['CertificateItem'] { + /** + * Create a DeletedCertificateItem. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted certificate. + * @member {date} [scheduledPurgeDate] The time when the certificate is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the certificate was deleted, in + * UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedCertificateItem + * + * @returns {object} metadata of DeletedCertificateItem + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedCertificateItem', + type: { + name: 'Composite', + className: 'DeletedCertificateItem', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + x509Thumbprint: { + required: false, + serializedName: 'x5t', + type: { + name: 'Base64Url' + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedCertificateItem; diff --git a/lib/services/keyvault/lib/models/deletedCertificateListResult.js b/lib/services/keyvault/lib/models/deletedCertificateListResult.js new file mode 100644 index 0000000000..6c16a2eb9c --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedCertificateListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of certificates that have been deleted in this vault. + */ +class DeletedCertificateListResult extends Array { + /** + * Create a DeletedCertificateListResult. + * @member {string} [nextLink] The URL to get the next set of deleted + * certificates. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedCertificateListResult + * + * @returns {object} metadata of DeletedCertificateListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedCertificateListResult', + type: { + name: 'Composite', + className: 'DeletedCertificateListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeletedCertificateItemElementType', + type: { + name: 'Composite', + className: 'DeletedCertificateItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedCertificateListResult; diff --git a/lib/services/keyvault/lib/models/deletedKeyBundle.js b/lib/services/keyvault/lib/models/deletedKeyBundle.js new file mode 100644 index 0000000000..b506a7bd5a --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedKeyBundle.js @@ -0,0 +1,115 @@ +/* + * 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 DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion + * info + * + * @extends models['KeyBundle'] + */ +class DeletedKeyBundle extends models['KeyBundle'] { + /** + * Create a DeletedKeyBundle. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted key. + * @member {date} [scheduledPurgeDate] The time when the key is scheduled to + * be purged, in UTC + * @member {date} [deletedDate] The time when the key was deleted, in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedKeyBundle + * + * @returns {object} metadata of DeletedKeyBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedKeyBundle', + type: { + name: 'Composite', + className: 'DeletedKeyBundle', + modelProperties: { + key: { + required: false, + serializedName: 'key', + type: { + name: 'Composite', + className: 'JsonWebKey' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managed: { + required: false, + readOnly: true, + serializedName: 'managed', + type: { + name: 'Boolean' + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedKeyBundle; diff --git a/lib/services/keyvault/lib/models/deletedKeyItem.js b/lib/services/keyvault/lib/models/deletedKeyItem.js new file mode 100644 index 0000000000..f5408da43a --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedKeyItem.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'); + +/** + * The deleted key item containing the deleted key metadata and information + * about deletion. + * + * @extends models['KeyItem'] + */ +class DeletedKeyItem extends models['KeyItem'] { + /** + * Create a DeletedKeyItem. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted key. + * @member {date} [scheduledPurgeDate] The time when the key is scheduled to + * be purged, in UTC + * @member {date} [deletedDate] The time when the key was deleted, in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedKeyItem + * + * @returns {object} metadata of DeletedKeyItem + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedKeyItem', + type: { + name: 'Composite', + className: 'DeletedKeyItem', + modelProperties: { + kid: { + required: false, + serializedName: 'kid', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managed: { + required: false, + readOnly: true, + serializedName: 'managed', + type: { + name: 'Boolean' + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedKeyItem; diff --git a/lib/services/keyvault/lib/models/deletedKeyListResult.js b/lib/services/keyvault/lib/models/deletedKeyListResult.js new file mode 100644 index 0000000000..ded944049f --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedKeyListResult.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'; + +/** + * A list of keys that have been deleted in this vault. + */ +class DeletedKeyListResult extends Array { + /** + * Create a DeletedKeyListResult. + * @member {string} [nextLink] The URL to get the next set of deleted keys. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedKeyListResult + * + * @returns {object} metadata of DeletedKeyListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedKeyListResult', + type: { + name: 'Composite', + className: 'DeletedKeyListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeletedKeyItemElementType', + type: { + name: 'Composite', + className: 'DeletedKeyItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedKeyListResult; diff --git a/lib/services/keyvault/lib/models/deletedSasDefinitionBundle.js b/lib/services/keyvault/lib/models/deletedSasDefinitionBundle.js new file mode 100644 index 0000000000..1d179fa87c --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSasDefinitionBundle.js @@ -0,0 +1,142 @@ +/* + * 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 SAS definition bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + * + * @extends models['SasDefinitionBundle'] + */ +class DeletedSasDefinitionBundle extends models['SasDefinitionBundle'] { + /** + * Create a DeletedSasDefinitionBundle. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted SAS definition. + * @member {date} [scheduledPurgeDate] The time when the SAS definition is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the SAS definition was deleted, + * in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSasDefinitionBundle + * + * @returns {object} metadata of DeletedSasDefinitionBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSasDefinitionBundle', + type: { + name: 'Composite', + className: 'DeletedSasDefinitionBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + secretId: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + templateUri: { + required: false, + readOnly: true, + serializedName: 'templateUri', + type: { + name: 'String' + } + }, + sasType: { + required: false, + readOnly: true, + serializedName: 'sasType', + type: { + name: 'String' + } + }, + validityPeriod: { + required: false, + readOnly: true, + serializedName: 'validityPeriod', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedSasDefinitionBundle; diff --git a/lib/services/keyvault/lib/models/deletedSasDefinitionItem.js b/lib/services/keyvault/lib/models/deletedSasDefinitionItem.js new file mode 100644 index 0000000000..67a6cec662 --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSasDefinitionItem.js @@ -0,0 +1,118 @@ +/* + * 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 deleted SAS definition item containing metadata about the deleted SAS + * definition. + * + * @extends models['SasDefinitionItem'] + */ +class DeletedSasDefinitionItem extends models['SasDefinitionItem'] { + /** + * Create a DeletedSasDefinitionItem. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted SAS definition. + * @member {date} [scheduledPurgeDate] The time when the SAS definition is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the SAS definition was deleted, + * in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSasDefinitionItem + * + * @returns {object} metadata of DeletedSasDefinitionItem + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSasDefinitionItem', + type: { + name: 'Composite', + className: 'DeletedSasDefinitionItem', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + secretId: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedSasDefinitionItem; diff --git a/lib/services/keyvault/lib/models/deletedSasDefinitionListResult.js b/lib/services/keyvault/lib/models/deletedSasDefinitionListResult.js new file mode 100644 index 0000000000..ce7274df6b --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSasDefinitionListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The deleted SAS definition list result + */ +class DeletedSasDefinitionListResult extends Array { + /** + * Create a DeletedSasDefinitionListResult. + * @member {string} [nextLink] The URL to get the next set of deleted SAS + * definitions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSasDefinitionListResult + * + * @returns {object} metadata of DeletedSasDefinitionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSasDefinitionListResult', + type: { + name: 'Composite', + className: 'DeletedSasDefinitionListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeletedSasDefinitionItemElementType', + type: { + name: 'Composite', + className: 'DeletedSasDefinitionItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedSasDefinitionListResult; diff --git a/lib/services/keyvault/lib/models/deletedSecretBundle.js b/lib/services/keyvault/lib/models/deletedSecretBundle.js new file mode 100644 index 0000000000..5fecbd600a --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSecretBundle.js @@ -0,0 +1,136 @@ +/* + * 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 Secret consisting of its previous id, attributes and its tags, as + * well as information on when it will be purged. + * + * @extends models['SecretBundle'] + */ +class DeletedSecretBundle extends models['SecretBundle'] { + /** + * Create a DeletedSecretBundle. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted secret. + * @member {date} [scheduledPurgeDate] The time when the secret is scheduled + * to be purged, in UTC + * @member {date} [deletedDate] The time when the secret was deleted, in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSecretBundle + * + * @returns {object} metadata of DeletedSecretBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSecretBundle', + type: { + name: 'Composite', + className: 'DeletedSecretBundle', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kid: { + required: false, + readOnly: true, + serializedName: 'kid', + type: { + name: 'String' + } + }, + managed: { + required: false, + readOnly: true, + serializedName: 'managed', + type: { + name: 'Boolean' + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedSecretBundle; diff --git a/lib/services/keyvault/lib/models/deletedSecretItem.js b/lib/services/keyvault/lib/models/deletedSecretItem.js new file mode 100644 index 0000000000..4ee56fe905 --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSecretItem.js @@ -0,0 +1,120 @@ +/* + * 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 deleted secret item containing metadata about the deleted secret. + * + * @extends models['SecretItem'] + */ +class DeletedSecretItem extends models['SecretItem'] { + /** + * Create a DeletedSecretItem. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted secret. + * @member {date} [scheduledPurgeDate] The time when the secret is scheduled + * to be purged, in UTC + * @member {date} [deletedDate] The time when the secret was deleted, in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSecretItem + * + * @returns {object} metadata of DeletedSecretItem + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSecretItem', + type: { + name: 'Composite', + className: 'DeletedSecretItem', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + managed: { + required: false, + readOnly: true, + serializedName: 'managed', + type: { + name: 'Boolean' + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedSecretItem; diff --git a/lib/services/keyvault/lib/models/deletedSecretListResult.js b/lib/services/keyvault/lib/models/deletedSecretListResult.js new file mode 100644 index 0000000000..9044f68bba --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSecretListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The deleted secret list result + */ +class DeletedSecretListResult extends Array { + /** + * Create a DeletedSecretListResult. + * @member {string} [nextLink] The URL to get the next set of deleted + * secrets. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSecretListResult + * + * @returns {object} metadata of DeletedSecretListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSecretListResult', + type: { + name: 'Composite', + className: 'DeletedSecretListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeletedSecretItemElementType', + type: { + name: 'Composite', + className: 'DeletedSecretItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedSecretListResult; diff --git a/lib/services/keyvault/lib/models/deletedStorageAccountItem.js b/lib/services/keyvault/lib/models/deletedStorageAccountItem.js new file mode 100644 index 0000000000..1dbc8e68c2 --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedStorageAccountItem.js @@ -0,0 +1,118 @@ +/* + * 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 deleted storage account item containing metadata about the deleted + * storage account. + * + * @extends models['StorageAccountItem'] + */ +class DeletedStorageAccountItem extends models['StorageAccountItem'] { + /** + * Create a DeletedStorageAccountItem. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted storage account. + * @member {date} [scheduledPurgeDate] The time when the storage account is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the storage account was + * deleted, in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedStorageAccountItem + * + * @returns {object} metadata of DeletedStorageAccountItem + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedStorageAccountItem', + type: { + name: 'Composite', + className: 'DeletedStorageAccountItem', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + readOnly: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedStorageAccountItem; diff --git a/lib/services/keyvault/lib/models/deletedStorageBundle.js b/lib/services/keyvault/lib/models/deletedStorageBundle.js new file mode 100644 index 0000000000..9c25a84c6c --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedStorageBundle.js @@ -0,0 +1,142 @@ +/* + * 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 storage account bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + * + * @extends models['StorageBundle'] + */ +class DeletedStorageBundle extends models['StorageBundle'] { + /** + * Create a DeletedStorageBundle. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted storage account. + * @member {date} [scheduledPurgeDate] The time when the storage account is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the storage account was + * deleted, in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedStorageBundle + * + * @returns {object} metadata of DeletedStorageBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedStorageBundle', + type: { + name: 'Composite', + className: 'DeletedStorageBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + readOnly: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + activeKeyName: { + required: false, + readOnly: true, + serializedName: 'activeKeyName', + type: { + name: 'String' + } + }, + autoRegenerateKey: { + required: false, + readOnly: true, + serializedName: 'autoRegenerateKey', + type: { + name: 'Boolean' + } + }, + regenerationPeriod: { + required: false, + readOnly: true, + serializedName: 'regenerationPeriod', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedStorageBundle; diff --git a/lib/services/keyvault/lib/models/deletedStorageListResult.js b/lib/services/keyvault/lib/models/deletedStorageListResult.js new file mode 100644 index 0000000000..1552959951 --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedStorageListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The deleted storage account list result + */ +class DeletedStorageListResult extends Array { + /** + * Create a DeletedStorageListResult. + * @member {string} [nextLink] The URL to get the next set of deleted storage + * accounts. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedStorageListResult + * + * @returns {object} metadata of DeletedStorageListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedStorageListResult', + type: { + name: 'Composite', + className: 'DeletedStorageListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeletedStorageAccountItemElementType', + type: { + name: 'Composite', + className: 'DeletedStorageAccountItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedStorageListResult; diff --git a/lib/services/keyvault/lib/models/errorModel.js b/lib/services/keyvault/lib/models/errorModel.js new file mode 100644 index 0000000000..ab5ace8977 --- /dev/null +++ b/lib/services/keyvault/lib/models/errorModel.js @@ -0,0 +1,72 @@ +/* + * 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 key vault server error. + * + */ +class ErrorModel { + /** + * Create a ErrorModel. + * @member {string} [code] The error code. + * @member {string} [message] The error message. + * @member {object} [innerError] + */ + constructor() { + } + + /** + * Defines the metadata of ErrorModel + * + * @returns {object} metadata of ErrorModel + * + */ + mapper() { + return { + required: false, + serializedName: 'Error', + type: { + name: 'Composite', + className: 'ErrorModel', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + innerError: { + required: false, + readOnly: true, + serializedName: 'innererror', + type: { + name: 'Composite', + className: 'ErrorModel' + } + } + } + } + }; + } +} + +module.exports = ErrorModel; diff --git a/lib/services/keyvault/lib/models/index.d.ts b/lib/services/keyvault/lib/models/index.d.ts new file mode 100644 index 0000000000..9703d0227b --- /dev/null +++ b/lib/services/keyvault/lib/models/index.d.ts @@ -0,0 +1,2204 @@ +/* + * 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 Attributes class. + * @constructor + * The object attributes managed by the KeyVault service. + * + * @member {boolean} [enabled] Determines whether the object is enabled. + * @member {date} [notBefore] Not before date in UTC. + * @member {date} [expires] Expiry date in UTC. + * @member {date} [created] Creation time in UTC. + * @member {date} [updated] Last updated time in UTC. + */ +export interface Attributes { + enabled?: boolean; + notBefore?: Date; + expires?: Date; + readonly created?: Date; + readonly updated?: Date; +} + +/** + * @class + * Initializes a new instance of the JsonWebKey class. + * @constructor + * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 + * + * @member {string} [kid] Key identifier. + * @member {string} [kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {array} [keyOps] + * @member {buffer} [n] RSA modulus. + * @member {buffer} [e] RSA public exponent. + * @member {buffer} [d] RSA private exponent, or the D component of an EC + * private key. + * @member {buffer} [dp] RSA private key parameter. + * @member {buffer} [dq] RSA private key parameter. + * @member {buffer} [qi] RSA private key parameter. + * @member {buffer} [p] RSA secret prime. + * @member {buffer} [q] RSA secret prime, with p < q. + * @member {buffer} [k] Symmetric key. + * @member {buffer} [t] HSM Token, used with 'Bring Your Own Key'. + * @member {string} [crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * @member {buffer} [x] X component of an EC public key. + * @member {buffer} [y] Y component of an EC public key. + */ +export interface JsonWebKey { + kid?: string; + kty?: string; + keyOps?: string[]; + n?: Buffer; + e?: Buffer; + d?: Buffer; + dp?: Buffer; + dq?: Buffer; + qi?: Buffer; + p?: Buffer; + q?: Buffer; + k?: Buffer; + t?: Buffer; + crv?: string; + x?: Buffer; + y?: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeyAttributes class. + * @constructor + * The attributes of a key managed by the key vault service. + * + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for keys in the current vault. If it contains + * 'Purgeable' the key can be permanently deleted by a privileged user; + * otherwise, only the system can purge the key, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + */ +export interface KeyAttributes extends Attributes { + readonly recoveryLevel?: string; +} + +/** + * @class + * Initializes a new instance of the KeyBundle class. + * @constructor + * A KeyBundle consisting of a WebKey plus its attributes. + * + * @member {object} [key] The Json web key. + * @member {string} [key.kid] Key identifier. + * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {array} [key.keyOps] + * @member {buffer} [key.n] RSA modulus. + * @member {buffer} [key.e] RSA public exponent. + * @member {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * @member {buffer} [key.dp] RSA private key parameter. + * @member {buffer} [key.dq] RSA private key parameter. + * @member {buffer} [key.qi] RSA private key parameter. + * @member {buffer} [key.p] RSA secret prime. + * @member {buffer} [key.q] RSA secret prime, with p < q. + * @member {buffer} [key.k] Symmetric key. + * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * @member {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * @member {buffer} [key.x] X component of an EC public key. + * @member {buffer} [key.y] Y component of an EC public key. + * @member {object} [attributes] The key management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for keys in the current vault. If it contains + * 'Purgeable' the key can be permanently deleted by a privileged user; + * otherwise, only the system can purge the key, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {boolean} [managed] True if the key's lifetime is managed by key + * vault. If this is a key backing a certificate, then managed will be true. + */ +export interface KeyBundle { + key?: JsonWebKey; + attributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; + readonly managed?: boolean; +} + +/** + * @class + * Initializes a new instance of the KeyItem class. + * @constructor + * The key item containing key metadata. + * + * @member {string} [kid] Key identifier. + * @member {object} [attributes] The key management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for keys in the current vault. If it contains + * 'Purgeable' the key can be permanently deleted by a privileged user; + * otherwise, only the system can purge the key, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {boolean} [managed] True if the key's lifetime is managed by key + * vault. If this is a key backing a certificate, then managed will be true. + */ +export interface KeyItem { + kid?: string; + attributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; + readonly managed?: boolean; +} + +/** + * @class + * Initializes a new instance of the DeletedKeyBundle class. + * @constructor + * A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion + * info + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted key. + * @member {date} [scheduledPurgeDate] The time when the key is scheduled to be + * purged, in UTC + * @member {date} [deletedDate] The time when the key was deleted, in UTC + */ +export interface DeletedKeyBundle extends KeyBundle { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the DeletedKeyItem class. + * @constructor + * The deleted key item containing the deleted key metadata and information + * about deletion. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted key. + * @member {date} [scheduledPurgeDate] The time when the key is scheduled to be + * purged, in UTC + * @member {date} [deletedDate] The time when the key was deleted, in UTC + */ +export interface DeletedKeyItem extends KeyItem { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the SecretAttributes class. + * @constructor + * The secret management attributes. + * + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for secrets in the current vault. If it contains + * 'Purgeable', the secret can be permanently deleted by a privileged user; + * otherwise, only the system can purge the secret, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + */ +export interface SecretAttributes extends Attributes { + readonly recoveryLevel?: string; +} + +/** + * @class + * Initializes a new instance of the SecretBundle class. + * @constructor + * A secret consisting of a value, id and its attributes. + * + * @member {string} [value] The secret value. + * @member {string} [id] The secret id. + * @member {string} [contentType] The content type of the secret. + * @member {object} [attributes] The secret management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for secrets in the current vault. If it contains + * 'Purgeable', the secret can be permanently deleted by a privileged user; + * otherwise, only the system can purge the secret, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {string} [kid] If this is a secret backing a KV certificate, then + * this field specifies the corresponding key backing the KV certificate. + * @member {boolean} [managed] True if the secret's lifetime is managed by key + * vault. If this is a secret backing a certificate, then managed will be true. + */ +export interface SecretBundle { + value?: string; + id?: string; + contentType?: string; + attributes?: SecretAttributes; + tags?: { [propertyName: string]: string }; + readonly kid?: string; + readonly managed?: boolean; +} + +/** + * @class + * Initializes a new instance of the SecretItem class. + * @constructor + * The secret item containing secret metadata. + * + * @member {string} [id] Secret identifier. + * @member {object} [attributes] The secret management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for secrets in the current vault. If it contains + * 'Purgeable', the secret can be permanently deleted by a privileged user; + * otherwise, only the system can purge the secret, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {string} [contentType] Type of the secret value such as a password. + * @member {boolean} [managed] True if the secret's lifetime is managed by key + * vault. If this is a key backing a certificate, then managed will be true. + */ +export interface SecretItem { + id?: string; + attributes?: SecretAttributes; + tags?: { [propertyName: string]: string }; + contentType?: string; + readonly managed?: boolean; +} + +/** + * @class + * Initializes a new instance of the DeletedSecretBundle class. + * @constructor + * A Deleted Secret consisting of its previous id, attributes and its tags, as + * well as information on when it will be purged. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted secret. + * @member {date} [scheduledPurgeDate] The time when the secret is scheduled to + * be purged, in UTC + * @member {date} [deletedDate] The time when the secret was deleted, in UTC + */ +export interface DeletedSecretBundle extends SecretBundle { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the DeletedSecretItem class. + * @constructor + * The deleted secret item containing metadata about the deleted secret. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted secret. + * @member {date} [scheduledPurgeDate] The time when the secret is scheduled to + * be purged, in UTC + * @member {date} [deletedDate] The time when the secret was deleted, in UTC + */ +export interface DeletedSecretItem extends SecretItem { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the SecretRestoreParameters class. + * @constructor + * The secret restore parameters. + * + * @member {buffer} secretBundleBackup The backup blob associated with a secret + * bundle. + */ +export interface SecretRestoreParameters { + secretBundleBackup: Buffer; +} + +/** + * @class + * Initializes a new instance of the StorageRestoreParameters class. + * @constructor + * The secret restore parameters. + * + * @member {buffer} storageBundleBackup The backup blob associated with a + * storage account. + */ +export interface StorageRestoreParameters { + storageBundleBackup: Buffer; +} + +/** + * @class + * Initializes a new instance of the CertificateAttributes class. + * @constructor + * The certificate management attributes. + * + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for certificates in the current vault. If it contains + * 'Purgeable', the certificate can be permanently deleted by a privileged + * user; otherwise, only the system can purge the certificate, at the end of + * the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + */ +export interface CertificateAttributes extends Attributes { + readonly recoveryLevel?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateItem class. + * @constructor + * The certificate item containing certificate metadata. + * + * @member {string} [id] Certificate identifier. + * @member {object} [attributes] The certificate management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for certificates in the current vault. If it + * contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {buffer} [x509Thumbprint] Thumbprint of the certificate. + */ +export interface CertificateItem { + id?: string; + attributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; + x509Thumbprint?: Buffer; +} + +/** + * @class + * Initializes a new instance of the CertificateIssuerItem class. + * @constructor + * The certificate issuer item containing certificate issuer metadata. + * + * @member {string} [id] Certificate Identifier. + * @member {string} [provider] The issuer provider. + */ +export interface CertificateIssuerItem { + id?: string; + provider?: string; +} + +/** + * @class + * Initializes a new instance of the KeyProperties class. + * @constructor + * Properties of the key pair backing a certificate. + * + * @member {boolean} [exportable] Indicates if the private key can be exported. + * @member {string} [keyType] The type of key pair to be used for the + * certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * @member {number} [keySize] The key size in bits. For example: 2048, 3072, or + * 4096 for RSA. + * @member {boolean} [reuseKey] Indicates if the same key pair will be used on + * certificate renewal. + * @member {string} [curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + */ +export interface KeyProperties { + exportable?: boolean; + keyType?: string; + keySize?: number; + reuseKey?: boolean; + curve?: string; +} + +/** + * @class + * Initializes a new instance of the SecretProperties class. + * @constructor + * Properties of the key backing a certificate. + * + * @member {string} [contentType] The media type (MIME type). + */ +export interface SecretProperties { + contentType?: string; +} + +/** + * @class + * Initializes a new instance of the SubjectAlternativeNames class. + * @constructor + * The subject alternate names of a X509 object. + * + * @member {array} [emails] Email addresses. + * @member {array} [dnsNames] Domain names. + * @member {array} [upns] User principal names. + */ +export interface SubjectAlternativeNames { + emails?: string[]; + dnsNames?: string[]; + upns?: string[]; +} + +/** + * @class + * Initializes a new instance of the X509CertificateProperties class. + * @constructor + * Properties of the X509 component of a certificate. + * + * @member {string} [subject] The subject name. Should be a valid X509 + * distinguished Name. + * @member {array} [ekus] The enhanced key usage. + * @member {object} [subjectAlternativeNames] The subject alternative names. + * @member {array} [subjectAlternativeNames.emails] Email addresses. + * @member {array} [subjectAlternativeNames.dnsNames] Domain names. + * @member {array} [subjectAlternativeNames.upns] User principal names. + * @member {array} [keyUsage] List of key usages. + * @member {number} [validityInMonths] The duration that the ceritifcate is + * valid in months. + */ +export interface X509CertificateProperties { + subject?: string; + ekus?: string[]; + subjectAlternativeNames?: SubjectAlternativeNames; + keyUsage?: string[]; + validityInMonths?: number; +} + +/** + * @class + * Initializes a new instance of the Trigger class. + * @constructor + * A condition to be satisfied for an action to be executed. + * + * @member {number} [lifetimePercentage] Percentage of lifetime at which to + * trigger. Value should be between 1 and 99. + * @member {number} [daysBeforeExpiry] Days before expiry to attempt renewal. + * Value should be between 1 and validity_in_months multiplied by 27. If + * validity_in_months is 36, then value should be between 1 and 972 (36 * 27). + */ +export interface Trigger { + lifetimePercentage?: number; + daysBeforeExpiry?: number; +} + +/** + * @class + * Initializes a new instance of the Action class. + * @constructor + * The action that will be executed. + * + * @member {string} [actionType] The type of the action. Possible values + * include: 'EmailContacts', 'AutoRenew' + */ +export interface Action { + actionType?: string; +} + +/** + * @class + * Initializes a new instance of the LifetimeAction class. + * @constructor + * Action and its trigger that will be performed by Key Vault over the lifetime + * of a certificate. + * + * @member {object} [trigger] The condition that will execute the action. + * @member {number} [trigger.lifetimePercentage] Percentage of lifetime at + * which to trigger. Value should be between 1 and 99. + * @member {number} [trigger.daysBeforeExpiry] Days before expiry to attempt + * renewal. Value should be between 1 and validity_in_months multiplied by 27. + * If validity_in_months is 36, then value should be between 1 and 972 (36 * + * 27). + * @member {object} [action] The action that will be executed. + * @member {string} [action.actionType] The type of the action. Possible values + * include: 'EmailContacts', 'AutoRenew' + */ +export interface LifetimeAction { + trigger?: Trigger; + action?: Action; +} + +/** + * @class + * Initializes a new instance of the IssuerParameters class. + * @constructor + * Parameters for the issuer of the X509 component of a certificate. + * + * @member {string} [name] Name of the referenced issuer object or reserved + * names; for example, 'Self' or 'Unknown'. + * @member {string} [certificateType] Type of certificate to be requested from + * the issuer provider. + * @member {boolean} [certificateTransparency] Indicates if the certificates + * generated under this policy should be published to certificate transparency + * logs. + */ +export interface IssuerParameters { + name?: string; + certificateType?: string; + certificateTransparency?: boolean; +} + +/** + * @class + * Initializes a new instance of the CertificatePolicy class. + * @constructor + * Management policy for a certificate. + * + * @member {string} [id] The certificate id. + * @member {object} [keyProperties] Properties of the key backing a + * certificate. + * @member {boolean} [keyProperties.exportable] Indicates if the private key + * can be exported. + * @member {string} [keyProperties.keyType] The type of key pair to be used for + * the certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * @member {number} [keyProperties.keySize] The key size in bits. For example: + * 2048, 3072, or 4096 for RSA. + * @member {boolean} [keyProperties.reuseKey] Indicates if the same key pair + * will be used on certificate renewal. + * @member {string} [keyProperties.curve] Elliptic curve name. For valid + * values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', + * 'P-521', 'P-256K' + * @member {object} [secretProperties] Properties of the secret backing a + * certificate. + * @member {string} [secretProperties.contentType] The media type (MIME type). + * @member {object} [x509CertificateProperties] Properties of the X509 + * component of a certificate. + * @member {string} [x509CertificateProperties.subject] The subject name. + * Should be a valid X509 distinguished Name. + * @member {array} [x509CertificateProperties.ekus] The enhanced key usage. + * @member {object} [x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * @member {array} [x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * @member {array} [x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * @member {array} [x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * @member {array} [x509CertificateProperties.keyUsage] List of key usages. + * @member {number} [x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * @member {array} [lifetimeActions] Actions that will be performed by Key + * Vault over the lifetime of a certificate. + * @member {object} [issuerParameters] Parameters for the issuer of the X509 + * component of a certificate. + * @member {string} [issuerParameters.name] Name of the referenced issuer + * object or reserved names; for example, 'Self' or 'Unknown'. + * @member {string} [issuerParameters.certificateType] Type of certificate to + * be requested from the issuer provider. + * @member {boolean} [issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {object} [attributes] The certificate attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for certificates in the current vault. If it + * contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + */ +export interface CertificatePolicy { + readonly id?: string; + keyProperties?: KeyProperties; + secretProperties?: SecretProperties; + x509CertificateProperties?: X509CertificateProperties; + lifetimeActions?: LifetimeAction[]; + issuerParameters?: IssuerParameters; + attributes?: CertificateAttributes; +} + +/** + * @class + * Initializes a new instance of the CertificateBundle class. + * @constructor + * A certificate bundle consists of a certificate (X509) plus its attributes. + * + * @member {string} [id] The certificate id. + * @member {string} [kid] The key id. + * @member {string} [sid] The secret id. + * @member {buffer} [x509Thumbprint] Thumbprint of the certificate. + * @member {object} [policy] The management policy. + * @member {string} [policy.id] The certificate id. + * @member {object} [policy.keyProperties] Properties of the key backing a + * certificate. + * @member {boolean} [policy.keyProperties.exportable] Indicates if the private + * key can be exported. + * @member {string} [policy.keyProperties.keyType] The type of key pair to be + * used for the certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', + * 'RSA-HSM', 'oct' + * @member {number} [policy.keyProperties.keySize] The key size in bits. For + * example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [policy.keyProperties.reuseKey] Indicates if the same key + * pair will be used on certificate renewal. + * @member {string} [policy.keyProperties.curve] Elliptic curve name. For valid + * values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', + * 'P-521', 'P-256K' + * @member {object} [policy.secretProperties] Properties of the secret backing + * a certificate. + * @member {string} [policy.secretProperties.contentType] The media type (MIME + * type). + * @member {object} [policy.x509CertificateProperties] Properties of the X509 + * component of a certificate. + * @member {string} [policy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * @member {array} [policy.x509CertificateProperties.ekus] The enhanced key + * usage. + * @member {object} [policy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.emails] Email + * addresses. + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.dnsNames] Domain + * names. + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.upns] User + * principal names. + * @member {array} [policy.x509CertificateProperties.keyUsage] List of key + * usages. + * @member {number} [policy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * @member {array} [policy.lifetimeActions] Actions that will be performed by + * Key Vault over the lifetime of a certificate. + * @member {object} [policy.issuerParameters] Parameters for the issuer of the + * X509 component of a certificate. + * @member {string} [policy.issuerParameters.name] Name of the referenced + * issuer object or reserved names; for example, 'Self' or 'Unknown'. + * @member {string} [policy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. + * @member {boolean} [policy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * @member {object} [policy.attributes] The certificate attributes. + * @member {string} [policy.attributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for certificates in the current vault. If + * it contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {buffer} [cer] CER contents of x509 certificate. + * @member {string} [contentType] The content type of the secret. + * @member {object} [attributes] The certificate attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for certificates in the current vault. If it + * contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs + */ +export interface CertificateBundle { + readonly id?: string; + readonly kid?: string; + readonly sid?: string; + readonly x509Thumbprint?: Buffer; + readonly policy?: CertificatePolicy; + cer?: Buffer; + contentType?: string; + attributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the DeletedCertificateBundle class. + * @constructor + * A Deleted Certificate consisting of its previous id, attributes and its + * tags, as well as information on when it will be purged. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted certificate. + * @member {date} [scheduledPurgeDate] The time when the certificate is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the certificate was deleted, in + * UTC + */ +export interface DeletedCertificateBundle extends CertificateBundle { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the DeletedCertificateItem class. + * @constructor + * The deleted certificate item containing metadata about the deleted + * certificate. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted certificate. + * @member {date} [scheduledPurgeDate] The time when the certificate is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the certificate was deleted, in + * UTC + */ +export interface DeletedCertificateItem extends CertificateItem { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * The key vault server error. + * + * @member {string} [code] The error code. + * @member {string} [message] The error message. + * @member {object} [innerError] + */ +export interface ErrorModel { + readonly code?: string; + readonly message?: string; + readonly innerError?: ErrorModel; +} + +/** + * @class + * Initializes a new instance of the CertificateOperation class. + * @constructor + * A certificate operation is returned in case of asynchronous requests. + * + * @member {string} [id] The certificate id. + * @member {object} [issuerParameters] Parameters for the issuer of the X509 + * component of a certificate. + * @member {string} [issuerParameters.name] Name of the referenced issuer + * object or reserved names; for example, 'Self' or 'Unknown'. + * @member {string} [issuerParameters.certificateType] Type of certificate to + * be requested from the issuer provider. + * @member {boolean} [issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {buffer} [csr] The certificate signing request (CSR) that is being + * used in the certificate operation. + * @member {boolean} [cancellationRequested] Indicates if cancellation was + * requested on the certificate operation. + * @member {string} [status] Status of the certificate operation. + * @member {string} [statusDetails] The status details of the certificate + * operation. + * @member {object} [error] Error encountered, if any, during the certificate + * operation. + * @member {string} [error.code] The error code. + * @member {string} [error.message] The error message. + * @member {object} [error.innerError] + * @member {string} [target] Location which contains the result of the + * certificate operation. + * @member {string} [requestId] Identifier for the certificate operation. + */ +export interface CertificateOperation { + readonly id?: string; + issuerParameters?: IssuerParameters; + csr?: Buffer; + cancellationRequested?: boolean; + status?: string; + statusDetails?: string; + error?: ErrorModel; + target?: string; + requestId?: string; +} + +/** + * @class + * Initializes a new instance of the IssuerCredentials class. + * @constructor + * The credentials to be used for the certificate issuer. + * + * @member {string} [accountId] The user name/account name/account id. + * @member {string} [password] The password/secret/account key. + */ +export interface IssuerCredentials { + accountId?: string; + password?: string; +} + +/** + * @class + * Initializes a new instance of the AdministratorDetails class. + * @constructor + * Details of the organization administrator of the certificate issuer. + * + * @member {string} [firstName] First name. + * @member {string} [lastName] Last name. + * @member {string} [emailAddress] Email addresss. + * @member {string} [phone] Phone number. + */ +export interface AdministratorDetails { + firstName?: string; + lastName?: string; + emailAddress?: string; + phone?: string; +} + +/** + * @class + * Initializes a new instance of the OrganizationDetails class. + * @constructor + * Details of the organization of the certificate issuer. + * + * @member {string} [id] Id of the organization. + * @member {array} [adminDetails] Details of the organization administrator. + */ +export interface OrganizationDetails { + id?: string; + adminDetails?: AdministratorDetails[]; +} + +/** + * @class + * Initializes a new instance of the IssuerAttributes class. + * @constructor + * The attributes of an issuer managed by the Key Vault service. + * + * @member {boolean} [enabled] Determines whether the issuer is enabled. + * @member {date} [created] Creation time in UTC. + * @member {date} [updated] Last updated time in UTC. + */ +export interface IssuerAttributes { + enabled?: boolean; + readonly created?: Date; + readonly updated?: Date; +} + +/** + * @class + * Initializes a new instance of the IssuerBundle class. + * @constructor + * The issuer for Key Vault certificate. + * + * @member {string} [id] Identifier for the issuer object. + * @member {string} [provider] The issuer provider. + * @member {object} [credentials] The credentials to be used for the issuer. + * @member {string} [credentials.accountId] The user name/account name/account + * id. + * @member {string} [credentials.password] The password/secret/account key. + * @member {object} [organizationDetails] Details of the organization as + * provided to the issuer. + * @member {string} [organizationDetails.id] Id of the organization. + * @member {array} [organizationDetails.adminDetails] Details of the + * organization administrator. + * @member {object} [attributes] Attributes of the issuer object. + * @member {boolean} [attributes.enabled] Determines whether the issuer is + * enabled. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + */ +export interface IssuerBundle { + readonly id?: string; + provider?: string; + credentials?: IssuerCredentials; + organizationDetails?: OrganizationDetails; + attributes?: IssuerAttributes; +} + +/** + * @class + * Initializes a new instance of the Contact class. + * @constructor + * The contact information for the vault certificates. + * + * @member {string} [emailAddress] Email addresss. + * @member {string} [name] Name. + * @member {string} [phone] Phone number. + */ +export interface Contact { + emailAddress?: string; + name?: string; + phone?: string; +} + +/** + * @class + * Initializes a new instance of the Contacts class. + * @constructor + * The contacts for the vault certificates. + * + * @member {string} [id] Identifier for the contacts collection. + * @member {array} [contactList] The contact list for the vault certificates. + */ +export interface Contacts { + readonly id?: string; + contactList?: Contact[]; +} + +/** + * @class + * Initializes a new instance of the KeyCreateParameters class. + * @constructor + * The key create parameters. + * + * @member {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * @member {number} [keySize] The key size in bits. For example: 2048, 3072, or + * 4096 for RSA. + * @member {array} [keyOps] + * @member {object} [keyAttributes] + * @member {string} [keyAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for keys in the current vault. If it + * contains 'Purgeable' the key can be permanently deleted by a privileged + * user; otherwise, only the system can purge the key, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {string} [curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + */ +export interface KeyCreateParameters { + kty: string; + keySize?: number; + keyOps?: string[]; + keyAttributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; + curve?: string; +} + +/** + * @class + * Initializes a new instance of the KeyImportParameters class. + * @constructor + * The key import parameters. + * + * @member {boolean} [hsm] Whether to import as a hardware key (HSM) or + * software key. + * @member {object} key The Json web key + * @member {string} [key.kid] Key identifier. + * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {array} [key.keyOps] + * @member {buffer} [key.n] RSA modulus. + * @member {buffer} [key.e] RSA public exponent. + * @member {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * @member {buffer} [key.dp] RSA private key parameter. + * @member {buffer} [key.dq] RSA private key parameter. + * @member {buffer} [key.qi] RSA private key parameter. + * @member {buffer} [key.p] RSA secret prime. + * @member {buffer} [key.q] RSA secret prime, with p < q. + * @member {buffer} [key.k] Symmetric key. + * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * @member {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * @member {buffer} [key.x] X component of an EC public key. + * @member {buffer} [key.y] Y component of an EC public key. + * @member {object} [keyAttributes] The key management attributes. + * @member {string} [keyAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for keys in the current vault. If it + * contains 'Purgeable' the key can be permanently deleted by a privileged + * user; otherwise, only the system can purge the key, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface KeyImportParameters { + hsm?: boolean; + key: JsonWebKey; + keyAttributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the KeyOperationsParameters class. + * @constructor + * The key operations parameters. + * + * @member {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {buffer} value + */ +export interface KeyOperationsParameters { + algorithm: string; + value: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeySignParameters class. + * @constructor + * The key operations parameters. + * + * @member {string} algorithm The signing/verification algorithm identifier. + * For more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * @member {buffer} value + */ +export interface KeySignParameters { + algorithm: string; + value: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeyVerifyParameters class. + * @constructor + * The key verify parameters. + * + * @member {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @member {buffer} digest The digest used for signing. + * @member {buffer} signature The signature to be verified. + */ +export interface KeyVerifyParameters { + algorithm: string; + digest: Buffer; + signature: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeyUpdateParameters class. + * @constructor + * The key update parameters. + * + * @member {array} [keyOps] Json web key operations. For more information on + * possible key operations, see JsonWebKeyOperation. + * @member {object} [keyAttributes] + * @member {string} [keyAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for keys in the current vault. If it + * contains 'Purgeable' the key can be permanently deleted by a privileged + * user; otherwise, only the system can purge the key, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface KeyUpdateParameters { + keyOps?: string[]; + keyAttributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the KeyRestoreParameters class. + * @constructor + * The key restore parameters. + * + * @member {buffer} keyBundleBackup The backup blob associated with a key + * bundle. + */ +export interface KeyRestoreParameters { + keyBundleBackup: Buffer; +} + +/** + * @class + * Initializes a new instance of the SecretSetParameters class. + * @constructor + * The secret set parameters. + * + * @member {string} value The value of the secret. + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {string} [contentType] Type of the secret value such as a password. + * @member {object} [secretAttributes] The secret management attributes. + * @member {string} [secretAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for secrets in the current vault. If it + * contains 'Purgeable', the secret can be permanently deleted by a privileged + * user; otherwise, only the system can purge the secret, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + */ +export interface SecretSetParameters { + value: string; + tags?: { [propertyName: string]: string }; + contentType?: string; + secretAttributes?: SecretAttributes; +} + +/** + * @class + * Initializes a new instance of the SecretUpdateParameters class. + * @constructor + * The secret update parameters. + * + * @member {string} [contentType] Type of the secret value such as a password. + * @member {object} [secretAttributes] The secret management attributes. + * @member {string} [secretAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for secrets in the current vault. If it + * contains 'Purgeable', the secret can be permanently deleted by a privileged + * user; otherwise, only the system can purge the secret, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface SecretUpdateParameters { + contentType?: string; + secretAttributes?: SecretAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateCreateParameters class. + * @constructor + * The certificate create parameters. + * + * @member {object} [certificatePolicy] The management policy for the + * certificate. + * @member {string} [certificatePolicy.id] The certificate id. + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * @member {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * @member {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * @member {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * @member {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * @member {string} [certificatePolicy.issuerParameters.certificateType] Type + * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {object} [certificatePolicy.attributes] The certificate attributes. + * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the current + * vault. If it contains 'Purgeable', the certificate can be permanently + * deleted by a privileged user; otherwise, only the system can purge the + * certificate, at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional). + * @member {string} [certificateAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for certificates in the current vault. If + * it contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface CertificateCreateParameters { + certificatePolicy?: CertificatePolicy; + certificateAttributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateImportParameters class. + * @constructor + * The certificate import parameters. + * + * @member {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * @member {string} [password] If the private key in base64EncodedCertificate + * is encrypted, the password used for encryption. + * @member {object} [certificatePolicy] The management policy for the + * certificate. + * @member {string} [certificatePolicy.id] The certificate id. + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * @member {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * @member {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * @member {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * @member {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * @member {string} [certificatePolicy.issuerParameters.certificateType] Type + * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {object} [certificatePolicy.attributes] The certificate attributes. + * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the current + * vault. If it contains 'Purgeable', the certificate can be permanently + * deleted by a privileged user; otherwise, only the system can purge the + * certificate, at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional). + * @member {string} [certificateAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for certificates in the current vault. If + * it contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface CertificateImportParameters { + base64EncodedCertificate: string; + password?: string; + certificatePolicy?: CertificatePolicy; + certificateAttributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateUpdateParameters class. + * @constructor + * The certificate update parameters. + * + * @member {object} [certificatePolicy] The management policy for the + * certificate. + * @member {string} [certificatePolicy.id] The certificate id. + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * @member {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * @member {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * @member {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * @member {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * @member {string} [certificatePolicy.issuerParameters.certificateType] Type + * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * @member {object} [certificatePolicy.attributes] The certificate attributes. + * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for certificates in the current + * vault. If it contains 'Purgeable', the certificate can be permanently + * deleted by a privileged user; otherwise, only the system can purge the + * certificate, at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional). + * @member {string} [certificateAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for certificates in the current vault. If + * it contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface CertificateUpdateParameters { + certificatePolicy?: CertificatePolicy; + certificateAttributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateMergeParameters class. + * @constructor + * The certificate merge parameters + * + * @member {array} x509Certificates The certificate or the certificate chain to + * merge. + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional). + * @member {string} [certificateAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for certificates in the current vault. If + * it contains 'Purgeable', the certificate can be permanently deleted by a + * privileged user; otherwise, only the system can purge the certificate, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface CertificateMergeParameters { + x509Certificates: Buffer[]; + certificateAttributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateIssuerSetParameters class. + * @constructor + * The certificate issuer set parameters. + * + * @member {string} provider The issuer provider. + * @member {object} [credentials] The credentials to be used for the issuer. + * @member {string} [credentials.accountId] The user name/account name/account + * id. + * @member {string} [credentials.password] The password/secret/account key. + * @member {object} [organizationDetails] Details of the organization as + * provided to the issuer. + * @member {string} [organizationDetails.id] Id of the organization. + * @member {array} [organizationDetails.adminDetails] Details of the + * organization administrator. + * @member {object} [attributes] Attributes of the issuer object. + * @member {boolean} [attributes.enabled] Determines whether the issuer is + * enabled. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + */ +export interface CertificateIssuerSetParameters { + provider: string; + credentials?: IssuerCredentials; + organizationDetails?: OrganizationDetails; + attributes?: IssuerAttributes; +} + +/** + * @class + * Initializes a new instance of the CertificateIssuerUpdateParameters class. + * @constructor + * The certificate issuer update parameters. + * + * @member {string} [provider] The issuer provider. + * @member {object} [credentials] The credentials to be used for the issuer. + * @member {string} [credentials.accountId] The user name/account name/account + * id. + * @member {string} [credentials.password] The password/secret/account key. + * @member {object} [organizationDetails] Details of the organization as + * provided to the issuer. + * @member {string} [organizationDetails.id] Id of the organization. + * @member {array} [organizationDetails.adminDetails] Details of the + * organization administrator. + * @member {object} [attributes] Attributes of the issuer object. + * @member {boolean} [attributes.enabled] Determines whether the issuer is + * enabled. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + */ +export interface CertificateIssuerUpdateParameters { + provider?: string; + credentials?: IssuerCredentials; + organizationDetails?: OrganizationDetails; + attributes?: IssuerAttributes; +} + +/** + * @class + * Initializes a new instance of the CertificateOperationUpdateParameter class. + * @constructor + * The certificate operation update parameters. + * + * @member {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate operation. + */ +export interface CertificateOperationUpdateParameter { + cancellationRequested: boolean; +} + +/** + * @class + * Initializes a new instance of the KeyOperationResult class. + * @constructor + * The key operation result. + * + * @member {string} [kid] Key identifier + * @member {buffer} [result] + */ +export interface KeyOperationResult { + readonly kid?: string; + readonly result?: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeyVerifyResult class. + * @constructor + * The key verify result. + * + * @member {boolean} [value] True if the signature is verified, otherwise + * false. + */ +export interface KeyVerifyResult { + readonly value?: boolean; +} + +/** + * @class + * Initializes a new instance of the BackupKeyResult class. + * @constructor + * The backup key result, containing the backup blob. + * + * @member {buffer} [value] The backup blob containing the backed up key. + */ +export interface BackupKeyResult { + readonly value?: Buffer; +} + +/** + * @class + * Initializes a new instance of the BackupSecretResult class. + * @constructor + * The backup secret result, containing the backup blob. + * + * @member {buffer} [value] The backup blob containing the backed up secret. + */ +export interface BackupSecretResult { + readonly value?: Buffer; +} + +/** + * @class + * Initializes a new instance of the BackupStorageResult class. + * @constructor + * The backup storage result, containing the backup blob. + * + * @member {buffer} [value] The backup blob containing the backed up storage + * account. + */ +export interface BackupStorageResult { + readonly value?: Buffer; +} + +/** + * @class + * Initializes a new instance of the PendingCertificateSigningRequestResult class. + * @constructor + * The pending certificate signing request result. + * + * @member {string} [value] The pending certificate signing request as Base64 + * encoded string. + */ +export interface PendingCertificateSigningRequestResult { + readonly value?: string; +} + +/** + * @class + * Initializes a new instance of the StorageAccountAttributes class. + * @constructor + * The storage account management attributes. + * + * @member {boolean} [enabled] the enabled state of the object. + * @member {date} [created] Creation time in UTC. + * @member {date} [updated] Last updated time in UTC. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + */ +export interface StorageAccountAttributes { + enabled?: boolean; + readonly created?: Date; + readonly updated?: Date; + readonly recoveryLevel?: string; +} + +/** + * @class + * Initializes a new instance of the StorageBundle class. + * @constructor + * A Storage account bundle consists of key vault storage account details plus + * its attributes. + * + * @member {string} [id] The storage account id. + * @member {string} [resourceId] The storage account resource id. + * @member {string} [activeKeyName] The current active storage account key + * name. + * @member {boolean} [autoRegenerateKey] whether keyvault should manage the + * storage account for the user. + * @member {string} [regenerationPeriod] The key regeneration time duration + * specified in ISO-8601 format. + * @member {object} [attributes] The storage account attributes. + * @member {boolean} [attributes.enabled] the enabled state of the object. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs + */ +export interface StorageBundle { + readonly id?: string; + readonly resourceId?: string; + readonly activeKeyName?: string; + readonly autoRegenerateKey?: boolean; + readonly regenerationPeriod?: string; + readonly attributes?: StorageAccountAttributes; + readonly tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the DeletedStorageBundle class. + * @constructor + * A deleted storage account bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted storage account. + * @member {date} [scheduledPurgeDate] The time when the storage account is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the storage account was deleted, + * in UTC + */ +export interface DeletedStorageBundle extends StorageBundle { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the StorageAccountCreateParameters class. + * @constructor + * The storage account create parameters. + * + * @member {string} resourceId Storage account resource id. + * @member {string} activeKeyName Current active storage account key name. + * @member {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * @member {string} [regenerationPeriod] The key regeneration time duration + * specified in ISO-8601 format. + * @member {object} [storageAccountAttributes] The attributes of the storage + * account. + * @member {boolean} [storageAccountAttributes.enabled] the enabled state of + * the object. + * @member {date} [storageAccountAttributes.created] Creation time in UTC. + * @member {date} [storageAccountAttributes.updated] Last updated time in UTC. + * @member {string} [storageAccountAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for storage accounts in the + * current vault. If it contains 'Purgeable' the storage account can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the storage account, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface StorageAccountCreateParameters { + resourceId: string; + activeKeyName: string; + autoRegenerateKey: boolean; + regenerationPeriod?: string; + storageAccountAttributes?: StorageAccountAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the StorageAccountUpdateParameters class. + * @constructor + * The storage account update parameters. + * + * @member {string} [activeKeyName] The current active storage account key + * name. + * @member {boolean} [autoRegenerateKey] whether keyvault should manage the + * storage account for the user. + * @member {string} [regenerationPeriod] The key regeneration time duration + * specified in ISO-8601 format. + * @member {object} [storageAccountAttributes] The attributes of the storage + * account. + * @member {boolean} [storageAccountAttributes.enabled] the enabled state of + * the object. + * @member {date} [storageAccountAttributes.created] Creation time in UTC. + * @member {date} [storageAccountAttributes.updated] Last updated time in UTC. + * @member {string} [storageAccountAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for storage accounts in the + * current vault. If it contains 'Purgeable' the storage account can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the storage account, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface StorageAccountUpdateParameters { + activeKeyName?: string; + autoRegenerateKey?: boolean; + regenerationPeriod?: string; + storageAccountAttributes?: StorageAccountAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the StorageAccountRegenerteKeyParameters class. + * @constructor + * The storage account key regenerate parameters. + * + * @member {string} keyName The storage account key name. + */ +export interface StorageAccountRegenerteKeyParameters { + keyName: string; +} + +/** + * @class + * Initializes a new instance of the StorageAccountItem class. + * @constructor + * The storage account item containing storage account metadata. + * + * @member {string} [id] Storage identifier. + * @member {string} [resourceId] Storage account resource Id. + * @member {object} [attributes] The storage account management attributes. + * @member {boolean} [attributes.enabled] the enabled state of the object. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface StorageAccountItem { + readonly id?: string; + readonly resourceId?: string; + readonly attributes?: StorageAccountAttributes; + readonly tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the DeletedStorageAccountItem class. + * @constructor + * The deleted storage account item containing metadata about the deleted + * storage account. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted storage account. + * @member {date} [scheduledPurgeDate] The time when the storage account is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the storage account was deleted, + * in UTC + */ +export interface DeletedStorageAccountItem extends StorageAccountItem { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the SasDefinitionAttributes class. + * @constructor + * The SAS definition management attributes. + * + * @member {boolean} [enabled] the enabled state of the object. + * @member {date} [created] Creation time in UTC. + * @member {date} [updated] Last updated time in UTC. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for SAS definitions in the current vault. If it contains + * 'Purgeable' the SAS definition can be permanently deleted by a privileged + * user; otherwise, only the system can purge the SAS definition, at the end of + * the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + */ +export interface SasDefinitionAttributes { + enabled?: boolean; + readonly created?: Date; + readonly updated?: Date; + readonly recoveryLevel?: string; +} + +/** + * @class + * Initializes a new instance of the SasDefinitionBundle class. + * @constructor + * A SAS definition bundle consists of key vault SAS definition details plus + * its attributes. + * + * @member {string} [id] The SAS definition id. + * @member {string} [secretId] Storage account SAS definition secret id. + * @member {string} [templateUri] The SAS definition token template signed with + * an arbitrary key. Tokens created according to the SAS definition will have + * the same properties as the template. + * @member {string} [sasType] The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} [validityPeriod] The validity period of SAS tokens created + * according to the SAS definition. + * @member {object} [attributes] The SAS definition attributes. + * @member {boolean} [attributes.enabled] the enabled state of the object. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs + */ +export interface SasDefinitionBundle { + readonly id?: string; + readonly secretId?: string; + readonly templateUri?: string; + readonly sasType?: string; + readonly validityPeriod?: string; + readonly attributes?: SasDefinitionAttributes; + readonly tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the DeletedSasDefinitionBundle class. + * @constructor + * A deleted SAS definition bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted SAS definition. + * @member {date} [scheduledPurgeDate] The time when the SAS definition is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the SAS definition was deleted, + * in UTC + */ +export interface DeletedSasDefinitionBundle extends SasDefinitionBundle { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the SasDefinitionItem class. + * @constructor + * The SAS definition item containing storage SAS definition metadata. + * + * @member {string} [id] The storage SAS identifier. + * @member {string} [secretId] The storage account SAS definition secret id. + * @member {object} [attributes] The SAS definition management attributes. + * @member {boolean} [attributes.enabled] the enabled state of the object. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface SasDefinitionItem { + readonly id?: string; + readonly secretId?: string; + readonly attributes?: SasDefinitionAttributes; + readonly tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the DeletedSasDefinitionItem class. + * @constructor + * The deleted SAS definition item containing metadata about the deleted SAS + * definition. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted SAS definition. + * @member {date} [scheduledPurgeDate] The time when the SAS definition is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the SAS definition was deleted, + * in UTC + */ +export interface DeletedSasDefinitionItem extends SasDefinitionItem { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + +/** + * @class + * Initializes a new instance of the SasDefinitionCreateParameters class. + * @constructor + * The SAS definition create parameters. + * + * @member {string} templateUri The SAS definition token template signed with + * an arbitrary key. Tokens created according to the SAS definition will have + * the same properties as the template. + * @member {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. + * @member {object} [sasDefinitionAttributes] The attributes of the SAS + * definition. + * @member {boolean} [sasDefinitionAttributes.enabled] the enabled state of the + * object. + * @member {date} [sasDefinitionAttributes.created] Creation time in UTC. + * @member {date} [sasDefinitionAttributes.updated] Last updated time in UTC. + * @member {string} [sasDefinitionAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for SAS definitions in the + * current vault. If it contains 'Purgeable' the SAS definition can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the SAS definition, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface SasDefinitionCreateParameters { + templateUri: string; + sasType: string; + validityPeriod: string; + sasDefinitionAttributes?: SasDefinitionAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the SasDefinitionUpdateParameters class. + * @constructor + * The SAS definition update parameters. + * + * @member {string} [templateUri] The SAS definition token template signed with + * an arbitrary key. Tokens created according to the SAS definition will have + * the same properties as the template. + * @member {string} [sasType] The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} [validityPeriod] The validity period of SAS tokens created + * according to the SAS definition. + * @member {object} [sasDefinitionAttributes] The attributes of the SAS + * definition. + * @member {boolean} [sasDefinitionAttributes.enabled] the enabled state of the + * object. + * @member {date} [sasDefinitionAttributes.created] Creation time in UTC. + * @member {date} [sasDefinitionAttributes.updated] Last updated time in UTC. + * @member {string} [sasDefinitionAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for SAS definitions in the + * current vault. If it contains 'Purgeable' the SAS definition can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the SAS definition, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ +export interface SasDefinitionUpdateParameters { + templateUri?: string; + sasType?: string; + validityPeriod?: string; + sasDefinitionAttributes?: SasDefinitionAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the KeyVaultError class. + * @constructor + * The key vault error exception. + * + * @member {object} [error] + * @member {string} [error.code] The error code. + * @member {string} [error.message] The error message. + * @member {object} [error.innerError] + */ +export interface KeyVaultError { + readonly error?: ErrorModel; +} + +/** + * @class + * Initializes a new instance of the CertificateRestoreParameters class. + * @constructor + * The certificate restore parameters. + * + * @member {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + */ +export interface CertificateRestoreParameters { + certificateBundleBackup: Buffer; +} + +/** + * @class + * Initializes a new instance of the BackupCertificateResult class. + * @constructor + * The backup certificate result, containing the backup blob. + * + * @member {buffer} [value] The backup blob containing the backed up + * certificate. + */ +export interface BackupCertificateResult { + readonly value?: Buffer; +} + + +/** + * @class + * Initializes a new instance of the KeyListResult class. + * @constructor + * The key list result. + * + * @member {string} [nextLink] The URL to get the next set of keys. + */ +export interface KeyListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DeletedKeyListResult class. + * @constructor + * A list of keys that have been deleted in this vault. + * + * @member {string} [nextLink] The URL to get the next set of deleted keys. + */ +export interface DeletedKeyListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SecretListResult class. + * @constructor + * The secret list result. + * + * @member {string} [nextLink] The URL to get the next set of secrets. + */ +export interface SecretListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DeletedSecretListResult class. + * @constructor + * The deleted secret list result + * + * @member {string} [nextLink] The URL to get the next set of deleted secrets. + */ +export interface DeletedSecretListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateListResult class. + * @constructor + * The certificate list result. + * + * @member {string} [nextLink] The URL to get the next set of certificates. + */ +export interface CertificateListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateIssuerListResult class. + * @constructor + * The certificate issuer list result. + * + * @member {string} [nextLink] The URL to get the next set of certificate + * issuers. + */ +export interface CertificateIssuerListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DeletedCertificateListResult class. + * @constructor + * A list of certificates that have been deleted in this vault. + * + * @member {string} [nextLink] The URL to get the next set of deleted + * certificates. + */ +export interface DeletedCertificateListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the StorageListResult class. + * @constructor + * The storage accounts list result. + * + * @member {string} [nextLink] The URL to get the next set of storage accounts. + */ +export interface StorageListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DeletedStorageListResult class. + * @constructor + * The deleted storage account list result + * + * @member {string} [nextLink] The URL to get the next set of deleted storage + * accounts. + */ +export interface DeletedStorageListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SasDefinitionListResult class. + * @constructor + * The storage account SAS definition list result. + * + * @member {string} [nextLink] The URL to get the next set of SAS defintions. + */ +export interface SasDefinitionListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DeletedSasDefinitionListResult class. + * @constructor + * The deleted SAS definition list result + * + * @member {string} [nextLink] The URL to get the next set of deleted SAS + * definitions. + */ +export interface DeletedSasDefinitionListResult extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/keyvault/lib/models/index.js b/lib/services/keyvault/lib/models/index.js new file mode 100644 index 0000000000..8514dd4e34 --- /dev/null +++ b/lib/services/keyvault/lib/models/index.js @@ -0,0 +1,109 @@ +/* + * 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.Attributes = require('./attributes'); +exports.JsonWebKey = require('./jsonWebKey'); +exports.KeyAttributes = require('./keyAttributes'); +exports.KeyBundle = require('./keyBundle'); +exports.KeyItem = require('./keyItem'); +exports.DeletedKeyBundle = require('./deletedKeyBundle'); +exports.DeletedKeyItem = require('./deletedKeyItem'); +exports.SecretAttributes = require('./secretAttributes'); +exports.SecretBundle = require('./secretBundle'); +exports.SecretItem = require('./secretItem'); +exports.DeletedSecretBundle = require('./deletedSecretBundle'); +exports.DeletedSecretItem = require('./deletedSecretItem'); +exports.SecretRestoreParameters = require('./secretRestoreParameters'); +exports.StorageRestoreParameters = require('./storageRestoreParameters'); +exports.CertificateAttributes = require('./certificateAttributes'); +exports.CertificateItem = require('./certificateItem'); +exports.CertificateIssuerItem = require('./certificateIssuerItem'); +exports.KeyProperties = require('./keyProperties'); +exports.SecretProperties = require('./secretProperties'); +exports.SubjectAlternativeNames = require('./subjectAlternativeNames'); +exports.X509CertificateProperties = require('./x509CertificateProperties'); +exports.Trigger = require('./trigger'); +exports.Action = require('./action'); +exports.LifetimeAction = require('./lifetimeAction'); +exports.IssuerParameters = require('./issuerParameters'); +exports.CertificatePolicy = require('./certificatePolicy'); +exports.CertificateBundle = require('./certificateBundle'); +exports.DeletedCertificateBundle = require('./deletedCertificateBundle'); +exports.DeletedCertificateItem = require('./deletedCertificateItem'); +exports.ErrorModel = require('./errorModel'); +exports.CertificateOperation = require('./certificateOperation'); +exports.IssuerCredentials = require('./issuerCredentials'); +exports.AdministratorDetails = require('./administratorDetails'); +exports.OrganizationDetails = require('./organizationDetails'); +exports.IssuerAttributes = require('./issuerAttributes'); +exports.IssuerBundle = require('./issuerBundle'); +exports.Contact = require('./contact'); +exports.Contacts = require('./contacts'); +exports.KeyCreateParameters = require('./keyCreateParameters'); +exports.KeyImportParameters = require('./keyImportParameters'); +exports.KeyOperationsParameters = require('./keyOperationsParameters'); +exports.KeySignParameters = require('./keySignParameters'); +exports.KeyVerifyParameters = require('./keyVerifyParameters'); +exports.KeyUpdateParameters = require('./keyUpdateParameters'); +exports.KeyRestoreParameters = require('./keyRestoreParameters'); +exports.SecretSetParameters = require('./secretSetParameters'); +exports.SecretUpdateParameters = require('./secretUpdateParameters'); +exports.CertificateCreateParameters = require('./certificateCreateParameters'); +exports.CertificateImportParameters = require('./certificateImportParameters'); +exports.CertificateUpdateParameters = require('./certificateUpdateParameters'); +exports.CertificateMergeParameters = require('./certificateMergeParameters'); +exports.CertificateIssuerSetParameters = require('./certificateIssuerSetParameters'); +exports.CertificateIssuerUpdateParameters = require('./certificateIssuerUpdateParameters'); +exports.CertificateOperationUpdateParameter = require('./certificateOperationUpdateParameter'); +exports.KeyOperationResult = require('./keyOperationResult'); +exports.KeyVerifyResult = require('./keyVerifyResult'); +exports.BackupKeyResult = require('./backupKeyResult'); +exports.BackupSecretResult = require('./backupSecretResult'); +exports.BackupStorageResult = require('./backupStorageResult'); +exports.PendingCertificateSigningRequestResult = require('./pendingCertificateSigningRequestResult'); +exports.StorageAccountAttributes = require('./storageAccountAttributes'); +exports.StorageBundle = require('./storageBundle'); +exports.DeletedStorageBundle = require('./deletedStorageBundle'); +exports.StorageAccountCreateParameters = require('./storageAccountCreateParameters'); +exports.StorageAccountUpdateParameters = require('./storageAccountUpdateParameters'); +exports.StorageAccountRegenerteKeyParameters = require('./storageAccountRegenerteKeyParameters'); +exports.StorageAccountItem = require('./storageAccountItem'); +exports.DeletedStorageAccountItem = require('./deletedStorageAccountItem'); +exports.SasDefinitionAttributes = require('./sasDefinitionAttributes'); +exports.SasDefinitionBundle = require('./sasDefinitionBundle'); +exports.DeletedSasDefinitionBundle = require('./deletedSasDefinitionBundle'); +exports.SasDefinitionItem = require('./sasDefinitionItem'); +exports.DeletedSasDefinitionItem = require('./deletedSasDefinitionItem'); +exports.SasDefinitionCreateParameters = require('./sasDefinitionCreateParameters'); +exports.SasDefinitionUpdateParameters = require('./sasDefinitionUpdateParameters'); +exports.KeyVaultError = require('./keyVaultError'); +exports.CertificateRestoreParameters = require('./certificateRestoreParameters'); +exports.BackupCertificateResult = require('./backupCertificateResult'); +exports.KeyListResult = require('./keyListResult'); +exports.DeletedKeyListResult = require('./deletedKeyListResult'); +exports.SecretListResult = require('./secretListResult'); +exports.DeletedSecretListResult = require('./deletedSecretListResult'); +exports.CertificateListResult = require('./certificateListResult'); +exports.CertificateIssuerListResult = require('./certificateIssuerListResult'); +exports.DeletedCertificateListResult = require('./deletedCertificateListResult'); +exports.StorageListResult = require('./storageListResult'); +exports.DeletedStorageListResult = require('./deletedStorageListResult'); +exports.SasDefinitionListResult = require('./sasDefinitionListResult'); +exports.DeletedSasDefinitionListResult = require('./deletedSasDefinitionListResult'); diff --git a/lib/services/keyvault/lib/models/issuerAttributes.js b/lib/services/keyvault/lib/models/issuerAttributes.js new file mode 100644 index 0000000000..c6690e244a --- /dev/null +++ b/lib/services/keyvault/lib/models/issuerAttributes.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The attributes of an issuer managed by the Key Vault service. + * + */ +class IssuerAttributes { + /** + * Create a IssuerAttributes. + * @member {boolean} [enabled] Determines whether the issuer is enabled. + * @member {date} [created] Creation time in UTC. + * @member {date} [updated] Last updated time in UTC. + */ + constructor() { + } + + /** + * Defines the metadata of IssuerAttributes + * + * @returns {object} metadata of IssuerAttributes + * + */ + mapper() { + return { + required: false, + serializedName: 'IssuerAttributes', + type: { + name: 'Composite', + className: 'IssuerAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = IssuerAttributes; diff --git a/lib/services/keyvault/lib/models/issuerBundle.js b/lib/services/keyvault/lib/models/issuerBundle.js new file mode 100644 index 0000000000..97c43689b0 --- /dev/null +++ b/lib/services/keyvault/lib/models/issuerBundle.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'; + +/** + * The issuer for Key Vault certificate. + * + */ +class IssuerBundle { + /** + * Create a IssuerBundle. + * @member {string} [id] Identifier for the issuer object. + * @member {string} [provider] The issuer provider. + * @member {object} [credentials] The credentials to be used for the issuer. + * @member {string} [credentials.accountId] The user name/account + * name/account id. + * @member {string} [credentials.password] The password/secret/account key. + * @member {object} [organizationDetails] Details of the organization as + * provided to the issuer. + * @member {string} [organizationDetails.id] Id of the organization. + * @member {array} [organizationDetails.adminDetails] Details of the + * organization administrator. + * @member {object} [attributes] Attributes of the issuer object. + * @member {boolean} [attributes.enabled] Determines whether the issuer is + * enabled. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + */ + constructor() { + } + + /** + * Defines the metadata of IssuerBundle + * + * @returns {object} metadata of IssuerBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'IssuerBundle', + type: { + name: 'Composite', + className: 'IssuerBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + credentials: { + required: false, + serializedName: 'credentials', + type: { + name: 'Composite', + className: 'IssuerCredentials' + } + }, + organizationDetails: { + required: false, + serializedName: 'org_details', + type: { + name: 'Composite', + className: 'OrganizationDetails' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'IssuerAttributes' + } + } + } + } + }; + } +} + +module.exports = IssuerBundle; diff --git a/lib/services/keyvault/lib/models/issuerCredentials.js b/lib/services/keyvault/lib/models/issuerCredentials.js new file mode 100644 index 0000000000..7546ec1a94 --- /dev/null +++ b/lib/services/keyvault/lib/models/issuerCredentials.js @@ -0,0 +1,60 @@ +/* + * 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 credentials to be used for the certificate issuer. + * + */ +class IssuerCredentials { + /** + * Create a IssuerCredentials. + * @member {string} [accountId] The user name/account name/account id. + * @member {string} [password] The password/secret/account key. + */ + constructor() { + } + + /** + * Defines the metadata of IssuerCredentials + * + * @returns {object} metadata of IssuerCredentials + * + */ + mapper() { + return { + required: false, + serializedName: 'IssuerCredentials', + type: { + name: 'Composite', + className: 'IssuerCredentials', + modelProperties: { + accountId: { + required: false, + serializedName: 'account_id', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'pwd', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IssuerCredentials; diff --git a/lib/services/keyvault/lib/models/issuerParameters.js b/lib/services/keyvault/lib/models/issuerParameters.js new file mode 100644 index 0000000000..ed0b95c84d --- /dev/null +++ b/lib/services/keyvault/lib/models/issuerParameters.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Parameters for the issuer of the X509 component of a certificate. + * + */ +class IssuerParameters { + /** + * Create a IssuerParameters. + * @member {string} [name] Name of the referenced issuer object or reserved + * names; for example, 'Self' or 'Unknown'. + * @member {string} [certificateType] Type of certificate to be requested + * from the issuer provider. + * @member {boolean} [certificateTransparency] Indicates if the certificates + * generated under this policy should be published to certificate + * transparency logs. + */ + constructor() { + } + + /** + * Defines the metadata of IssuerParameters + * + * @returns {object} metadata of IssuerParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'IssuerParameters', + type: { + name: 'Composite', + className: 'IssuerParameters', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + certificateType: { + required: false, + serializedName: 'cty', + type: { + name: 'String' + } + }, + certificateTransparency: { + required: false, + serializedName: 'cert_transparency', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = IssuerParameters; diff --git a/lib/services/keyvault/lib/models/jsonWebKey.js b/lib/services/keyvault/lib/models/jsonWebKey.js new file mode 100644 index 0000000000..b79057c182 --- /dev/null +++ b/lib/services/keyvault/lib/models/jsonWebKey.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'; + +/** + * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 + * + */ +class JsonWebKey { + /** + * Create a JsonWebKey. + * @member {string} [kid] Key identifier. + * @member {string} [kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {array} [keyOps] + * @member {buffer} [n] RSA modulus. + * @member {buffer} [e] RSA public exponent. + * @member {buffer} [d] RSA private exponent, or the D component of an EC + * private key. + * @member {buffer} [dp] RSA private key parameter. + * @member {buffer} [dq] RSA private key parameter. + * @member {buffer} [qi] RSA private key parameter. + * @member {buffer} [p] RSA secret prime. + * @member {buffer} [q] RSA secret prime, with p < q. + * @member {buffer} [k] Symmetric key. + * @member {buffer} [t] HSM Token, used with 'Bring Your Own Key'. + * @member {string} [crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * @member {buffer} [x] X component of an EC public key. + * @member {buffer} [y] Y component of an EC public key. + */ + constructor() { + } + + /** + * Defines the metadata of JsonWebKey + * + * @returns {object} metadata of JsonWebKey + * + */ + mapper() { + return { + required: false, + serializedName: 'JsonWebKey', + type: { + name: 'Composite', + className: 'JsonWebKey', + modelProperties: { + kid: { + required: false, + serializedName: 'kid', + type: { + name: 'String' + } + }, + kty: { + required: false, + serializedName: 'kty', + type: { + name: 'String' + } + }, + keyOps: { + required: false, + serializedName: 'key_ops', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + n: { + required: false, + serializedName: 'n', + type: { + name: 'Base64Url' + } + }, + e: { + required: false, + serializedName: 'e', + type: { + name: 'Base64Url' + } + }, + d: { + required: false, + serializedName: 'd', + type: { + name: 'Base64Url' + } + }, + dp: { + required: false, + serializedName: 'dp', + type: { + name: 'Base64Url' + } + }, + dq: { + required: false, + serializedName: 'dq', + type: { + name: 'Base64Url' + } + }, + qi: { + required: false, + serializedName: 'qi', + type: { + name: 'Base64Url' + } + }, + p: { + required: false, + serializedName: 'p', + type: { + name: 'Base64Url' + } + }, + q: { + required: false, + serializedName: 'q', + type: { + name: 'Base64Url' + } + }, + k: { + required: false, + serializedName: 'k', + type: { + name: 'Base64Url' + } + }, + t: { + required: false, + serializedName: 'key_hsm', + type: { + name: 'Base64Url' + } + }, + crv: { + required: false, + serializedName: 'crv', + type: { + name: 'String' + } + }, + x: { + required: false, + serializedName: 'x', + type: { + name: 'Base64Url' + } + }, + y: { + required: false, + serializedName: 'y', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = JsonWebKey; diff --git a/lib/services/keyvault/lib/models/keyAttributes.js b/lib/services/keyvault/lib/models/keyAttributes.js new file mode 100644 index 0000000000..9ce35133ae --- /dev/null +++ b/lib/services/keyvault/lib/models/keyAttributes.js @@ -0,0 +1,100 @@ +/* + * 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 attributes of a key managed by the key vault service. + * + * @extends models['Attributes'] + */ +class KeyAttributes extends models['Attributes'] { + /** + * Create a KeyAttributes. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for keys in the current vault. If it contains + * 'Purgeable' the key can be permanently deleted by a privileged user; + * otherwise, only the system can purge the key, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of KeyAttributes + * + * @returns {object} metadata of KeyAttributes + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyAttributes', + type: { + name: 'Composite', + className: 'KeyAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + notBefore: { + required: false, + serializedName: 'nbf', + type: { + name: 'UnixTime' + } + }, + expires: { + required: false, + serializedName: 'exp', + type: { + name: 'UnixTime' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + }, + recoveryLevel: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'recoveryLevel', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = KeyAttributes; diff --git a/lib/services/keyvault/lib/models/keyBundle.js b/lib/services/keyvault/lib/models/keyBundle.js new file mode 100644 index 0000000000..b0d8ccc846 --- /dev/null +++ b/lib/services/keyvault/lib/models/keyBundle.js @@ -0,0 +1,115 @@ +/* + * 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'; + +/** + * A KeyBundle consisting of a WebKey plus its attributes. + * + */ +class KeyBundle { + /** + * Create a KeyBundle. + * @member {object} [key] The Json web key. + * @member {string} [key.kid] Key identifier. + * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {array} [key.keyOps] + * @member {buffer} [key.n] RSA modulus. + * @member {buffer} [key.e] RSA public exponent. + * @member {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * @member {buffer} [key.dp] RSA private key parameter. + * @member {buffer} [key.dq] RSA private key parameter. + * @member {buffer} [key.qi] RSA private key parameter. + * @member {buffer} [key.p] RSA secret prime. + * @member {buffer} [key.q] RSA secret prime, with p < q. + * @member {buffer} [key.k] Symmetric key. + * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * @member {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * @member {buffer} [key.x] X component of an EC public key. + * @member {buffer} [key.y] Y component of an EC public key. + * @member {object} [attributes] The key management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for keys in the current vault. If it contains + * 'Purgeable' the key can be permanently deleted by a privileged user; + * otherwise, only the system can purge the key, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {boolean} [managed] True if the key's lifetime is managed by key + * vault. If this is a key backing a certificate, then managed will be true. + */ + constructor() { + } + + /** + * Defines the metadata of KeyBundle + * + * @returns {object} metadata of KeyBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyBundle', + type: { + name: 'Composite', + className: 'KeyBundle', + modelProperties: { + key: { + required: false, + serializedName: 'key', + type: { + name: 'Composite', + className: 'JsonWebKey' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managed: { + required: false, + readOnly: true, + serializedName: 'managed', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = KeyBundle; diff --git a/lib/services/keyvault/lib/models/keyCreateParameters.js b/lib/services/keyvault/lib/models/keyCreateParameters.js new file mode 100644 index 0000000000..eb18dbd7c9 --- /dev/null +++ b/lib/services/keyvault/lib/models/keyCreateParameters.js @@ -0,0 +1,123 @@ +/* + * 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 key create parameters. + * + */ +class KeyCreateParameters { + /** + * Create a KeyCreateParameters. + * @member {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * @member {number} [keySize] The key size in bits. For example: 2048, 3072, + * or 4096 for RSA. + * @member {array} [keyOps] + * @member {object} [keyAttributes] + * @member {string} [keyAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for keys in the current vault. If it + * contains 'Purgeable' the key can be permanently deleted by a privileged + * user; otherwise, only the system can purge the key, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {string} [curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + */ + constructor() { + } + + /** + * Defines the metadata of KeyCreateParameters + * + * @returns {object} metadata of KeyCreateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyCreateParameters', + type: { + name: 'Composite', + className: 'KeyCreateParameters', + modelProperties: { + kty: { + required: true, + serializedName: 'kty', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + keySize: { + required: false, + serializedName: 'key_size', + type: { + name: 'Number' + } + }, + keyOps: { + required: false, + serializedName: 'key_ops', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JsonWebKeyOperationElementType', + type: { + name: 'String' + } + } + } + }, + keyAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + curve: { + required: false, + serializedName: 'crv', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = KeyCreateParameters; diff --git a/lib/services/keyvault/lib/models/keyImportParameters.js b/lib/services/keyvault/lib/models/keyImportParameters.js new file mode 100644 index 0000000000..fe34a3114c --- /dev/null +++ b/lib/services/keyvault/lib/models/keyImportParameters.js @@ -0,0 +1,115 @@ +/* + * 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 key import parameters. + * + */ +class KeyImportParameters { + /** + * Create a KeyImportParameters. + * @member {boolean} [hsm] Whether to import as a hardware key (HSM) or + * software key. + * @member {object} key The Json web key + * @member {string} [key.kid] Key identifier. + * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {array} [key.keyOps] + * @member {buffer} [key.n] RSA modulus. + * @member {buffer} [key.e] RSA public exponent. + * @member {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * @member {buffer} [key.dp] RSA private key parameter. + * @member {buffer} [key.dq] RSA private key parameter. + * @member {buffer} [key.qi] RSA private key parameter. + * @member {buffer} [key.p] RSA secret prime. + * @member {buffer} [key.q] RSA secret prime, with p < q. + * @member {buffer} [key.k] Symmetric key. + * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * @member {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * @member {buffer} [key.x] X component of an EC public key. + * @member {buffer} [key.y] Y component of an EC public key. + * @member {object} [keyAttributes] The key management attributes. + * @member {string} [keyAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for keys in the current vault. If it + * contains 'Purgeable' the key can be permanently deleted by a privileged + * user; otherwise, only the system can purge the key, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of KeyImportParameters + * + * @returns {object} metadata of KeyImportParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyImportParameters', + type: { + name: 'Composite', + className: 'KeyImportParameters', + modelProperties: { + hsm: { + required: false, + serializedName: 'Hsm', + type: { + name: 'Boolean' + } + }, + key: { + required: true, + serializedName: 'key', + type: { + name: 'Composite', + className: 'JsonWebKey' + } + }, + keyAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = KeyImportParameters; diff --git a/lib/services/keyvault/lib/models/keyItem.js b/lib/services/keyvault/lib/models/keyItem.js new file mode 100644 index 0000000000..a1e11e32ea --- /dev/null +++ b/lib/services/keyvault/lib/models/keyItem.js @@ -0,0 +1,93 @@ +/* + * 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 key item containing key metadata. + * + */ +class KeyItem { + /** + * Create a KeyItem. + * @member {string} [kid] Key identifier. + * @member {object} [attributes] The key management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for keys in the current vault. If it contains + * 'Purgeable' the key can be permanently deleted by a privileged user; + * otherwise, only the system can purge the key, at the end of the retention + * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', + * 'Recoverable', 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {boolean} [managed] True if the key's lifetime is managed by key + * vault. If this is a key backing a certificate, then managed will be true. + */ + constructor() { + } + + /** + * Defines the metadata of KeyItem + * + * @returns {object} metadata of KeyItem + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyItem', + type: { + name: 'Composite', + className: 'KeyItem', + modelProperties: { + kid: { + required: false, + serializedName: 'kid', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managed: { + required: false, + readOnly: true, + serializedName: 'managed', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = KeyItem; diff --git a/lib/services/keyvault/lib/models/keyListResult.js b/lib/services/keyvault/lib/models/keyListResult.js new file mode 100644 index 0000000000..b0e12381ed --- /dev/null +++ b/lib/services/keyvault/lib/models/keyListResult.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'; + +/** + * The key list result. + */ +class KeyListResult extends Array { + /** + * Create a KeyListResult. + * @member {string} [nextLink] The URL to get the next set of keys. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of KeyListResult + * + * @returns {object} metadata of KeyListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyListResult', + type: { + name: 'Composite', + className: 'KeyListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'KeyItemElementType', + type: { + name: 'Composite', + className: 'KeyItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = KeyListResult; diff --git a/lib/services/keyvault/lib/models/keyOperationResult.js b/lib/services/keyvault/lib/models/keyOperationResult.js new file mode 100644 index 0000000000..8c81a8975e --- /dev/null +++ b/lib/services/keyvault/lib/models/keyOperationResult.js @@ -0,0 +1,62 @@ +/* + * 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 key operation result. + * + */ +class KeyOperationResult { + /** + * Create a KeyOperationResult. + * @member {string} [kid] Key identifier + * @member {buffer} [result] + */ + constructor() { + } + + /** + * Defines the metadata of KeyOperationResult + * + * @returns {object} metadata of KeyOperationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyOperationResult', + type: { + name: 'Composite', + className: 'KeyOperationResult', + modelProperties: { + kid: { + required: false, + readOnly: true, + serializedName: 'kid', + type: { + name: 'String' + } + }, + result: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = KeyOperationResult; diff --git a/lib/services/keyvault/lib/models/keyOperationsParameters.js b/lib/services/keyvault/lib/models/keyOperationsParameters.js new file mode 100644 index 0000000000..9a7dde8b6b --- /dev/null +++ b/lib/services/keyvault/lib/models/keyOperationsParameters.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The key operations parameters. + * + */ +class KeyOperationsParameters { + /** + * Create a KeyOperationsParameters. + * @member {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {buffer} value + */ + constructor() { + } + + /** + * Defines the metadata of KeyOperationsParameters + * + * @returns {object} metadata of KeyOperationsParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyOperationsParameters', + type: { + name: 'Composite', + className: 'KeyOperationsParameters', + modelProperties: { + algorithm: { + required: true, + serializedName: 'alg', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = KeyOperationsParameters; diff --git a/lib/services/keyvault/lib/models/keyProperties.js b/lib/services/keyvault/lib/models/keyProperties.js new file mode 100644 index 0000000000..734dfa7b0b --- /dev/null +++ b/lib/services/keyvault/lib/models/keyProperties.js @@ -0,0 +1,91 @@ +/* + * 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 of the key pair backing a certificate. + * + */ +class KeyProperties { + /** + * Create a KeyProperties. + * @member {boolean} [exportable] Indicates if the private key can be + * exported. + * @member {string} [keyType] The type of key pair to be used for the + * certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * @member {number} [keySize] The key size in bits. For example: 2048, 3072, + * or 4096 for RSA. + * @member {boolean} [reuseKey] Indicates if the same key pair will be used + * on certificate renewal. + * @member {string} [curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + */ + constructor() { + } + + /** + * Defines the metadata of KeyProperties + * + * @returns {object} metadata of KeyProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyProperties', + type: { + name: 'Composite', + className: 'KeyProperties', + modelProperties: { + exportable: { + required: false, + serializedName: 'exportable', + type: { + name: 'Boolean' + } + }, + keyType: { + required: false, + serializedName: 'kty', + type: { + name: 'String' + } + }, + keySize: { + required: false, + serializedName: 'key_size', + type: { + name: 'Number' + } + }, + reuseKey: { + required: false, + serializedName: 'reuse_key', + type: { + name: 'Boolean' + } + }, + curve: { + required: false, + serializedName: 'crv', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = KeyProperties; diff --git a/lib/services/keyvault/lib/models/keyRestoreParameters.js b/lib/services/keyvault/lib/models/keyRestoreParameters.js new file mode 100644 index 0000000000..4bb82b7750 --- /dev/null +++ b/lib/services/keyvault/lib/models/keyRestoreParameters.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The key restore parameters. + * + */ +class KeyRestoreParameters { + /** + * Create a KeyRestoreParameters. + * @member {buffer} keyBundleBackup The backup blob associated with a key + * bundle. + */ + constructor() { + } + + /** + * Defines the metadata of KeyRestoreParameters + * + * @returns {object} metadata of KeyRestoreParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyRestoreParameters', + type: { + name: 'Composite', + className: 'KeyRestoreParameters', + modelProperties: { + keyBundleBackup: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = KeyRestoreParameters; diff --git a/lib/services/keyvault/lib/models/keySignParameters.js b/lib/services/keyvault/lib/models/keySignParameters.js new file mode 100644 index 0000000000..d2255b7aa3 --- /dev/null +++ b/lib/services/keyvault/lib/models/keySignParameters.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The key operations parameters. + * + */ +class KeySignParameters { + /** + * Create a KeySignParameters. + * @member {string} algorithm The signing/verification algorithm identifier. + * For more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * @member {buffer} value + */ + constructor() { + } + + /** + * Defines the metadata of KeySignParameters + * + * @returns {object} metadata of KeySignParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'KeySignParameters', + type: { + name: 'Composite', + className: 'KeySignParameters', + modelProperties: { + algorithm: { + required: true, + serializedName: 'alg', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = KeySignParameters; diff --git a/lib/services/keyvault/lib/models/keyUpdateParameters.js b/lib/services/keyvault/lib/models/keyUpdateParameters.js new file mode 100644 index 0000000000..9cafd1f018 --- /dev/null +++ b/lib/services/keyvault/lib/models/keyUpdateParameters.js @@ -0,0 +1,92 @@ +/* + * 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 key update parameters. + * + */ +class KeyUpdateParameters { + /** + * Create a KeyUpdateParameters. + * @member {array} [keyOps] Json web key operations. For more information on + * possible key operations, see JsonWebKeyOperation. + * @member {object} [keyAttributes] + * @member {string} [keyAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for keys in the current vault. If it + * contains 'Purgeable' the key can be permanently deleted by a privileged + * user; otherwise, only the system can purge the key, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of KeyUpdateParameters + * + * @returns {object} metadata of KeyUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyUpdateParameters', + type: { + name: 'Composite', + className: 'KeyUpdateParameters', + modelProperties: { + keyOps: { + required: false, + serializedName: 'key_ops', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JsonWebKeyOperationElementType', + type: { + name: 'String' + } + } + } + }, + keyAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = KeyUpdateParameters; diff --git a/lib/services/keyvault/lib/models/keyVaultError.js b/lib/services/keyvault/lib/models/keyVaultError.js new file mode 100644 index 0000000000..859cb7f7c1 --- /dev/null +++ b/lib/services/keyvault/lib/models/keyVaultError.js @@ -0,0 +1,57 @@ +/* + * 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 key vault error exception. + * + */ +class KeyVaultError { + /** + * Create a KeyVaultError. + * @member {object} [error] + * @member {string} [error.code] The error code. + * @member {string} [error.message] The error message. + * @member {object} [error.innerError] + */ + constructor() { + } + + /** + * Defines the metadata of KeyVaultError + * + * @returns {object} metadata of KeyVaultError + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVaultError', + type: { + name: 'Composite', + className: 'KeyVaultError', + modelProperties: { + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ErrorModel' + } + } + } + } + }; + } +} + +module.exports = KeyVaultError; diff --git a/lib/services/keyvault/lib/models/keyVerifyParameters.js b/lib/services/keyvault/lib/models/keyVerifyParameters.js new file mode 100644 index 0000000000..ab1689822f --- /dev/null +++ b/lib/services/keyvault/lib/models/keyVerifyParameters.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 key verify parameters. + * + */ +class KeyVerifyParameters { + /** + * Create a KeyVerifyParameters. + * @member {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * @member {buffer} digest The digest used for signing. + * @member {buffer} signature The signature to be verified. + */ + constructor() { + } + + /** + * Defines the metadata of KeyVerifyParameters + * + * @returns {object} metadata of KeyVerifyParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVerifyParameters', + type: { + name: 'Composite', + className: 'KeyVerifyParameters', + modelProperties: { + algorithm: { + required: true, + serializedName: 'alg', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + digest: { + required: true, + serializedName: 'digest', + type: { + name: 'Base64Url' + } + }, + signature: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = KeyVerifyParameters; diff --git a/lib/services/keyvault/lib/models/keyVerifyResult.js b/lib/services/keyvault/lib/models/keyVerifyResult.js new file mode 100644 index 0000000000..2420b6ca0f --- /dev/null +++ b/lib/services/keyvault/lib/models/keyVerifyResult.js @@ -0,0 +1,54 @@ +/* + * 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 key verify result. + * + */ +class KeyVerifyResult { + /** + * Create a KeyVerifyResult. + * @member {boolean} [value] True if the signature is verified, otherwise + * false. + */ + constructor() { + } + + /** + * Defines the metadata of KeyVerifyResult + * + * @returns {object} metadata of KeyVerifyResult + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVerifyResult', + type: { + name: 'Composite', + className: 'KeyVerifyResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = KeyVerifyResult; diff --git a/lib/services/keyvault/lib/models/lifetimeAction.js b/lib/services/keyvault/lib/models/lifetimeAction.js new file mode 100644 index 0000000000..309113555c --- /dev/null +++ b/lib/services/keyvault/lib/models/lifetimeAction.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Action and its trigger that will be performed by Key Vault over the lifetime + * of a certificate. + * + */ +class LifetimeAction { + /** + * Create a LifetimeAction. + * @member {object} [trigger] The condition that will execute the action. + * @member {number} [trigger.lifetimePercentage] Percentage of lifetime at + * which to trigger. Value should be between 1 and 99. + * @member {number} [trigger.daysBeforeExpiry] Days before expiry to attempt + * renewal. Value should be between 1 and validity_in_months multiplied by + * 27. If validity_in_months is 36, then value should be between 1 and 972 + * (36 * 27). + * @member {object} [action] The action that will be executed. + * @member {string} [action.actionType] The type of the action. Possible + * values include: 'EmailContacts', 'AutoRenew' + */ + constructor() { + } + + /** + * Defines the metadata of LifetimeAction + * + * @returns {object} metadata of LifetimeAction + * + */ + mapper() { + return { + required: false, + serializedName: 'LifetimeAction', + type: { + name: 'Composite', + className: 'LifetimeAction', + modelProperties: { + trigger: { + required: false, + serializedName: 'trigger', + type: { + name: 'Composite', + className: 'Trigger' + } + }, + action: { + required: false, + serializedName: 'action', + type: { + name: 'Composite', + className: 'Action' + } + } + } + } + }; + } +} + +module.exports = LifetimeAction; diff --git a/lib/services/keyvault/lib/models/organizationDetails.js b/lib/services/keyvault/lib/models/organizationDetails.js new file mode 100644 index 0000000000..ac8db515fa --- /dev/null +++ b/lib/services/keyvault/lib/models/organizationDetails.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'; + +/** + * Details of the organization of the certificate issuer. + * + */ +class OrganizationDetails { + /** + * Create a OrganizationDetails. + * @member {string} [id] Id of the organization. + * @member {array} [adminDetails] Details of the organization administrator. + */ + constructor() { + } + + /** + * Defines the metadata of OrganizationDetails + * + * @returns {object} metadata of OrganizationDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'OrganizationDetails', + type: { + name: 'Composite', + className: 'OrganizationDetails', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + adminDetails: { + required: false, + serializedName: 'admin_details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AdministratorDetailsElementType', + type: { + name: 'Composite', + className: 'AdministratorDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = OrganizationDetails; diff --git a/lib/services/keyvault/lib/models/pendingCertificateSigningRequestResult.js b/lib/services/keyvault/lib/models/pendingCertificateSigningRequestResult.js new file mode 100644 index 0000000000..a0bbf01c71 --- /dev/null +++ b/lib/services/keyvault/lib/models/pendingCertificateSigningRequestResult.js @@ -0,0 +1,54 @@ +/* + * 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 pending certificate signing request result. + * + */ +class PendingCertificateSigningRequestResult { + /** + * Create a PendingCertificateSigningRequestResult. + * @member {string} [value] The pending certificate signing request as Base64 + * encoded string. + */ + constructor() { + } + + /** + * Defines the metadata of PendingCertificateSigningRequestResult + * + * @returns {object} metadata of PendingCertificateSigningRequestResult + * + */ + mapper() { + return { + required: false, + serializedName: 'PendingCertificateSigningRequestResult', + type: { + name: 'Composite', + className: 'PendingCertificateSigningRequestResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PendingCertificateSigningRequestResult; diff --git a/lib/services/keyvault/lib/models/sasDefinitionAttributes.js b/lib/services/keyvault/lib/models/sasDefinitionAttributes.js new file mode 100644 index 0000000000..d51b8c33d9 --- /dev/null +++ b/lib/services/keyvault/lib/models/sasDefinitionAttributes.js @@ -0,0 +1,86 @@ +/* + * 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 SAS definition management attributes. + * + */ +class SasDefinitionAttributes { + /** + * Create a SasDefinitionAttributes. + * @member {boolean} [enabled] the enabled state of the object. + * @member {date} [created] Creation time in UTC. + * @member {date} [updated] Last updated time in UTC. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + */ + constructor() { + } + + /** + * Defines the metadata of SasDefinitionAttributes + * + * @returns {object} metadata of SasDefinitionAttributes + * + */ + mapper() { + return { + required: false, + serializedName: 'SasDefinitionAttributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + }, + recoveryLevel: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'recoveryLevel', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SasDefinitionAttributes; diff --git a/lib/services/keyvault/lib/models/sasDefinitionBundle.js b/lib/services/keyvault/lib/models/sasDefinitionBundle.js new file mode 100644 index 0000000000..fdb58ee921 --- /dev/null +++ b/lib/services/keyvault/lib/models/sasDefinitionBundle.js @@ -0,0 +1,131 @@ +/* + * 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'; + +/** + * A SAS definition bundle consists of key vault SAS definition details plus + * its attributes. + * + */ +class SasDefinitionBundle { + /** + * Create a SasDefinitionBundle. + * @member {string} [id] The SAS definition id. + * @member {string} [secretId] Storage account SAS definition secret id. + * @member {string} [templateUri] The SAS definition token template signed + * with an arbitrary key. Tokens created according to the SAS definition + * will have the same properties as the template. + * @member {string} [sasType] The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} [validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. + * @member {object} [attributes] The SAS definition attributes. + * @member {boolean} [attributes.enabled] the enabled state of the object. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs + */ + constructor() { + } + + /** + * Defines the metadata of SasDefinitionBundle + * + * @returns {object} metadata of SasDefinitionBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'SasDefinitionBundle', + type: { + name: 'Composite', + className: 'SasDefinitionBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + secretId: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + templateUri: { + required: false, + readOnly: true, + serializedName: 'templateUri', + type: { + name: 'String' + } + }, + sasType: { + required: false, + readOnly: true, + serializedName: 'sasType', + type: { + name: 'String' + } + }, + validityPeriod: { + required: false, + readOnly: true, + serializedName: 'validityPeriod', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = SasDefinitionBundle; diff --git a/lib/services/keyvault/lib/models/sasDefinitionCreateParameters.js b/lib/services/keyvault/lib/models/sasDefinitionCreateParameters.js new file mode 100644 index 0000000000..2f4e0de248 --- /dev/null +++ b/lib/services/keyvault/lib/models/sasDefinitionCreateParameters.js @@ -0,0 +1,109 @@ +/* + * 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 SAS definition create parameters. + * + */ +class SasDefinitionCreateParameters { + /** + * Create a SasDefinitionCreateParameters. + * @member {string} templateUri The SAS definition token template signed with + * an arbitrary key. Tokens created according to the SAS definition will + * have the same properties as the template. + * @member {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. + * @member {object} [sasDefinitionAttributes] The attributes of the SAS + * definition. + * @member {boolean} [sasDefinitionAttributes.enabled] the enabled state of + * the object. + * @member {date} [sasDefinitionAttributes.created] Creation time in UTC. + * @member {date} [sasDefinitionAttributes.updated] Last updated time in UTC. + * @member {string} [sasDefinitionAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for SAS definitions in the + * current vault. If it contains 'Purgeable' the SAS definition can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the SAS definition, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of SasDefinitionCreateParameters + * + * @returns {object} metadata of SasDefinitionCreateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SasDefinitionCreateParameters', + type: { + name: 'Composite', + className: 'SasDefinitionCreateParameters', + modelProperties: { + templateUri: { + required: true, + serializedName: 'templateUri', + type: { + name: 'String' + } + }, + sasType: { + required: true, + serializedName: 'sasType', + type: { + name: 'String' + } + }, + validityPeriod: { + required: true, + serializedName: 'validityPeriod', + type: { + name: 'String' + } + }, + sasDefinitionAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = SasDefinitionCreateParameters; diff --git a/lib/services/keyvault/lib/models/sasDefinitionItem.js b/lib/services/keyvault/lib/models/sasDefinitionItem.js new file mode 100644 index 0000000000..351fc673d6 --- /dev/null +++ b/lib/services/keyvault/lib/models/sasDefinitionItem.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'; + +/** + * The SAS definition item containing storage SAS definition metadata. + * + */ +class SasDefinitionItem { + /** + * Create a SasDefinitionItem. + * @member {string} [id] The storage SAS identifier. + * @member {string} [secretId] The storage account SAS definition secret id. + * @member {object} [attributes] The SAS definition management attributes. + * @member {boolean} [attributes.enabled] the enabled state of the object. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of SasDefinitionItem + * + * @returns {object} metadata of SasDefinitionItem + * + */ + mapper() { + return { + required: false, + serializedName: 'SasDefinitionItem', + type: { + name: 'Composite', + className: 'SasDefinitionItem', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + secretId: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = SasDefinitionItem; diff --git a/lib/services/keyvault/lib/models/sasDefinitionListResult.js b/lib/services/keyvault/lib/models/sasDefinitionListResult.js new file mode 100644 index 0000000000..c7cd00ba8f --- /dev/null +++ b/lib/services/keyvault/lib/models/sasDefinitionListResult.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'; + +/** + * The storage account SAS definition list result. + */ +class SasDefinitionListResult extends Array { + /** + * Create a SasDefinitionListResult. + * @member {string} [nextLink] The URL to get the next set of SAS defintions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SasDefinitionListResult + * + * @returns {object} metadata of SasDefinitionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SasDefinitionListResult', + type: { + name: 'Composite', + className: 'SasDefinitionListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SasDefinitionItemElementType', + type: { + name: 'Composite', + className: 'SasDefinitionItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SasDefinitionListResult; diff --git a/lib/services/keyvault/lib/models/sasDefinitionUpdateParameters.js b/lib/services/keyvault/lib/models/sasDefinitionUpdateParameters.js new file mode 100644 index 0000000000..2a8a99a2e6 --- /dev/null +++ b/lib/services/keyvault/lib/models/sasDefinitionUpdateParameters.js @@ -0,0 +1,109 @@ +/* + * 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 SAS definition update parameters. + * + */ +class SasDefinitionUpdateParameters { + /** + * Create a SasDefinitionUpdateParameters. + * @member {string} [templateUri] The SAS definition token template signed + * with an arbitrary key. Tokens created according to the SAS definition + * will have the same properties as the template. + * @member {string} [sasType] The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} [validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. + * @member {object} [sasDefinitionAttributes] The attributes of the SAS + * definition. + * @member {boolean} [sasDefinitionAttributes.enabled] the enabled state of + * the object. + * @member {date} [sasDefinitionAttributes.created] Creation time in UTC. + * @member {date} [sasDefinitionAttributes.updated] Last updated time in UTC. + * @member {string} [sasDefinitionAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for SAS definitions in the + * current vault. If it contains 'Purgeable' the SAS definition can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the SAS definition, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of SasDefinitionUpdateParameters + * + * @returns {object} metadata of SasDefinitionUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SasDefinitionUpdateParameters', + type: { + name: 'Composite', + className: 'SasDefinitionUpdateParameters', + modelProperties: { + templateUri: { + required: false, + serializedName: 'templateUri', + type: { + name: 'String' + } + }, + sasType: { + required: false, + serializedName: 'sasType', + type: { + name: 'String' + } + }, + validityPeriod: { + required: false, + serializedName: 'validityPeriod', + type: { + name: 'String' + } + }, + sasDefinitionAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = SasDefinitionUpdateParameters; diff --git a/lib/services/keyvault/lib/models/secretAttributes.js b/lib/services/keyvault/lib/models/secretAttributes.js new file mode 100644 index 0000000000..8ebf803385 --- /dev/null +++ b/lib/services/keyvault/lib/models/secretAttributes.js @@ -0,0 +1,101 @@ +/* + * 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 secret management attributes. + * + * @extends models['Attributes'] + */ +class SecretAttributes extends models['Attributes'] { + /** + * Create a SecretAttributes. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for secrets in the current vault. If it contains + * 'Purgeable', the secret can be permanently deleted by a privileged user; + * otherwise, only the system can purge the secret, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SecretAttributes + * + * @returns {object} metadata of SecretAttributes + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretAttributes', + type: { + name: 'Composite', + className: 'SecretAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + notBefore: { + required: false, + serializedName: 'nbf', + type: { + name: 'UnixTime' + } + }, + expires: { + required: false, + serializedName: 'exp', + type: { + name: 'UnixTime' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + }, + recoveryLevel: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'recoveryLevel', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretAttributes; diff --git a/lib/services/keyvault/lib/models/secretBundle.js b/lib/services/keyvault/lib/models/secretBundle.js new file mode 100644 index 0000000000..03e06547c2 --- /dev/null +++ b/lib/services/keyvault/lib/models/secretBundle.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'; + +/** + * A secret consisting of a value, id and its attributes. + * + */ +class SecretBundle { + /** + * Create a SecretBundle. + * @member {string} [value] The secret value. + * @member {string} [id] The secret id. + * @member {string} [contentType] The content type of the secret. + * @member {object} [attributes] The secret management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for secrets in the current vault. If it contains + * 'Purgeable', the secret can be permanently deleted by a privileged user; + * otherwise, only the system can purge the secret, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {string} [kid] If this is a secret backing a KV certificate, then + * this field specifies the corresponding key backing the KV certificate. + * @member {boolean} [managed] True if the secret's lifetime is managed by + * key vault. If this is a secret backing a certificate, then managed will be + * true. + */ + constructor() { + } + + /** + * Defines the metadata of SecretBundle + * + * @returns {object} metadata of SecretBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretBundle', + type: { + name: 'Composite', + className: 'SecretBundle', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kid: { + required: false, + readOnly: true, + serializedName: 'kid', + type: { + name: 'String' + } + }, + managed: { + required: false, + readOnly: true, + serializedName: 'managed', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SecretBundle; diff --git a/lib/services/keyvault/lib/models/secretItem.js b/lib/services/keyvault/lib/models/secretItem.js new file mode 100644 index 0000000000..2b087f12dd --- /dev/null +++ b/lib/services/keyvault/lib/models/secretItem.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'; + +/** + * The secret item containing secret metadata. + * + */ +class SecretItem { + /** + * Create a SecretItem. + * @member {string} [id] Secret identifier. + * @member {object} [attributes] The secret management attributes. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for secrets in the current vault. If it contains + * 'Purgeable', the secret can be permanently deleted by a privileged user; + * otherwise, only the system can purge the secret, at the end of the + * retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {string} [contentType] Type of the secret value such as a + * password. + * @member {boolean} [managed] True if the secret's lifetime is managed by + * key vault. If this is a key backing a certificate, then managed will be + * true. + */ + constructor() { + } + + /** + * Defines the metadata of SecretItem + * + * @returns {object} metadata of SecretItem + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretItem', + type: { + name: 'Composite', + className: 'SecretItem', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + managed: { + required: false, + readOnly: true, + serializedName: 'managed', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SecretItem; diff --git a/lib/services/keyvault/lib/models/secretListResult.js b/lib/services/keyvault/lib/models/secretListResult.js new file mode 100644 index 0000000000..0b3f9b2ca5 --- /dev/null +++ b/lib/services/keyvault/lib/models/secretListResult.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'; + +/** + * The secret list result. + */ +class SecretListResult extends Array { + /** + * Create a SecretListResult. + * @member {string} [nextLink] The URL to get the next set of secrets. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SecretListResult + * + * @returns {object} metadata of SecretListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretListResult', + type: { + name: 'Composite', + className: 'SecretListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecretItemElementType', + type: { + name: 'Composite', + className: 'SecretItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretListResult; diff --git a/lib/services/keyvault/lib/models/secretProperties.js b/lib/services/keyvault/lib/models/secretProperties.js new file mode 100644 index 0000000000..a613f9bd08 --- /dev/null +++ b/lib/services/keyvault/lib/models/secretProperties.js @@ -0,0 +1,52 @@ +/* + * 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 of the key backing a certificate. + * + */ +class SecretProperties { + /** + * Create a SecretProperties. + * @member {string} [contentType] The media type (MIME type). + */ + constructor() { + } + + /** + * Defines the metadata of SecretProperties + * + * @returns {object} metadata of SecretProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretProperties', + type: { + name: 'Composite', + className: 'SecretProperties', + modelProperties: { + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretProperties; diff --git a/lib/services/keyvault/lib/models/secretRestoreParameters.js b/lib/services/keyvault/lib/models/secretRestoreParameters.js new file mode 100644 index 0000000000..c2832d143b --- /dev/null +++ b/lib/services/keyvault/lib/models/secretRestoreParameters.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The secret restore parameters. + * + */ +class SecretRestoreParameters { + /** + * Create a SecretRestoreParameters. + * @member {buffer} secretBundleBackup The backup blob associated with a + * secret bundle. + */ + constructor() { + } + + /** + * Defines the metadata of SecretRestoreParameters + * + * @returns {object} metadata of SecretRestoreParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretRestoreParameters', + type: { + name: 'Composite', + className: 'SecretRestoreParameters', + modelProperties: { + secretBundleBackup: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = SecretRestoreParameters; diff --git a/lib/services/keyvault/lib/models/secretSetParameters.js b/lib/services/keyvault/lib/models/secretSetParameters.js new file mode 100644 index 0000000000..957cb7b7b4 --- /dev/null +++ b/lib/services/keyvault/lib/models/secretSetParameters.js @@ -0,0 +1,93 @@ +/* + * 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 secret set parameters. + * + */ +class SecretSetParameters { + /** + * Create a SecretSetParameters. + * @member {string} value The value of the secret. + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + * @member {string} [contentType] Type of the secret value such as a + * password. + * @member {object} [secretAttributes] The secret management attributes. + * @member {string} [secretAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for secrets in the current vault. If it + * contains 'Purgeable', the secret can be permanently deleted by a + * privileged user; otherwise, only the system can purge the secret, at the + * end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + */ + constructor() { + } + + /** + * Defines the metadata of SecretSetParameters + * + * @returns {object} metadata of SecretSetParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretSetParameters', + type: { + name: 'Composite', + className: 'SecretSetParameters', + modelProperties: { + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + secretAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + } + } + } + }; + } +} + +module.exports = SecretSetParameters; diff --git a/lib/services/keyvault/lib/models/secretUpdateParameters.js b/lib/services/keyvault/lib/models/secretUpdateParameters.js new file mode 100644 index 0000000000..3883915c13 --- /dev/null +++ b/lib/services/keyvault/lib/models/secretUpdateParameters.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'; + +/** + * The secret update parameters. + * + */ +class SecretUpdateParameters { + /** + * Create a SecretUpdateParameters. + * @member {string} [contentType] Type of the secret value such as a + * password. + * @member {object} [secretAttributes] The secret management attributes. + * @member {string} [secretAttributes.recoveryLevel] Reflects the deletion + * recovery level currently in effect for secrets in the current vault. If it + * contains 'Purgeable', the secret can be permanently deleted by a + * privileged user; otherwise, only the system can purge the secret, at the + * end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of SecretUpdateParameters + * + * @returns {object} metadata of SecretUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretUpdateParameters', + type: { + name: 'Composite', + className: 'SecretUpdateParameters', + modelProperties: { + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + secretAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = SecretUpdateParameters; diff --git a/lib/services/keyvault/lib/models/storageAccountAttributes.js b/lib/services/keyvault/lib/models/storageAccountAttributes.js new file mode 100644 index 0000000000..f39e7ba4de --- /dev/null +++ b/lib/services/keyvault/lib/models/storageAccountAttributes.js @@ -0,0 +1,86 @@ +/* + * 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 storage account management attributes. + * + */ +class StorageAccountAttributes { + /** + * Create a StorageAccountAttributes. + * @member {boolean} [enabled] the enabled state of the object. + * @member {date} [created] Creation time in UTC. + * @member {date} [updated] Last updated time in UTC. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + */ + constructor() { + } + + /** + * Defines the metadata of StorageAccountAttributes + * + * @returns {object} metadata of StorageAccountAttributes + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageAccountAttributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + }, + recoveryLevel: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'recoveryLevel', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = StorageAccountAttributes; diff --git a/lib/services/keyvault/lib/models/storageAccountCreateParameters.js b/lib/services/keyvault/lib/models/storageAccountCreateParameters.js new file mode 100644 index 0000000000..880a345a10 --- /dev/null +++ b/lib/services/keyvault/lib/models/storageAccountCreateParameters.js @@ -0,0 +1,116 @@ +/* + * 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 storage account create parameters. + * + */ +class StorageAccountCreateParameters { + /** + * Create a StorageAccountCreateParameters. + * @member {string} resourceId Storage account resource id. + * @member {string} activeKeyName Current active storage account key name. + * @member {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * @member {string} [regenerationPeriod] The key regeneration time duration + * specified in ISO-8601 format. + * @member {object} [storageAccountAttributes] The attributes of the storage + * account. + * @member {boolean} [storageAccountAttributes.enabled] the enabled state of + * the object. + * @member {date} [storageAccountAttributes.created] Creation time in UTC. + * @member {date} [storageAccountAttributes.updated] Last updated time in + * UTC. + * @member {string} [storageAccountAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for storage accounts in the + * current vault. If it contains 'Purgeable' the storage account can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the storage account, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of StorageAccountCreateParameters + * + * @returns {object} metadata of StorageAccountCreateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageAccountCreateParameters', + type: { + name: 'Composite', + className: 'StorageAccountCreateParameters', + modelProperties: { + resourceId: { + required: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + activeKeyName: { + required: true, + serializedName: 'activeKeyName', + type: { + name: 'String' + } + }, + autoRegenerateKey: { + required: true, + serializedName: 'autoRegenerateKey', + type: { + name: 'Boolean' + } + }, + regenerationPeriod: { + required: false, + serializedName: 'regenerationPeriod', + type: { + name: 'String' + } + }, + storageAccountAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = StorageAccountCreateParameters; diff --git a/lib/services/keyvault/lib/models/storageAccountItem.js b/lib/services/keyvault/lib/models/storageAccountItem.js new file mode 100644 index 0000000000..ee57aebc3f --- /dev/null +++ b/lib/services/keyvault/lib/models/storageAccountItem.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'; + +/** + * The storage account item containing storage account metadata. + * + */ +class StorageAccountItem { + /** + * Create a StorageAccountItem. + * @member {string} [id] Storage identifier. + * @member {string} [resourceId] Storage account resource Id. + * @member {object} [attributes] The storage account management attributes. + * @member {boolean} [attributes.enabled] the enabled state of the object. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of StorageAccountItem + * + * @returns {object} metadata of StorageAccountItem + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageAccountItem', + type: { + name: 'Composite', + className: 'StorageAccountItem', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + readOnly: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = StorageAccountItem; diff --git a/lib/services/keyvault/lib/models/storageAccountRegenerteKeyParameters.js b/lib/services/keyvault/lib/models/storageAccountRegenerteKeyParameters.js new file mode 100644 index 0000000000..7e65d5f1a4 --- /dev/null +++ b/lib/services/keyvault/lib/models/storageAccountRegenerteKeyParameters.js @@ -0,0 +1,52 @@ +/* + * 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 storage account key regenerate parameters. + * + */ +class StorageAccountRegenerteKeyParameters { + /** + * Create a StorageAccountRegenerteKeyParameters. + * @member {string} keyName The storage account key name. + */ + constructor() { + } + + /** + * Defines the metadata of StorageAccountRegenerteKeyParameters + * + * @returns {object} metadata of StorageAccountRegenerteKeyParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageAccountRegenerteKeyParameters', + type: { + name: 'Composite', + className: 'StorageAccountRegenerteKeyParameters', + modelProperties: { + keyName: { + required: true, + serializedName: 'keyName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = StorageAccountRegenerteKeyParameters; diff --git a/lib/services/keyvault/lib/models/storageAccountUpdateParameters.js b/lib/services/keyvault/lib/models/storageAccountUpdateParameters.js new file mode 100644 index 0000000000..65154beb86 --- /dev/null +++ b/lib/services/keyvault/lib/models/storageAccountUpdateParameters.js @@ -0,0 +1,109 @@ +/* + * 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 storage account update parameters. + * + */ +class StorageAccountUpdateParameters { + /** + * Create a StorageAccountUpdateParameters. + * @member {string} [activeKeyName] The current active storage account key + * name. + * @member {boolean} [autoRegenerateKey] whether keyvault should manage the + * storage account for the user. + * @member {string} [regenerationPeriod] The key regeneration time duration + * specified in ISO-8601 format. + * @member {object} [storageAccountAttributes] The attributes of the storage + * account. + * @member {boolean} [storageAccountAttributes.enabled] the enabled state of + * the object. + * @member {date} [storageAccountAttributes.created] Creation time in UTC. + * @member {date} [storageAccountAttributes.updated] Last updated time in + * UTC. + * @member {string} [storageAccountAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for storage accounts in the + * current vault. If it contains 'Purgeable' the storage account can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the storage account, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs. + */ + constructor() { + } + + /** + * Defines the metadata of StorageAccountUpdateParameters + * + * @returns {object} metadata of StorageAccountUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageAccountUpdateParameters', + type: { + name: 'Composite', + className: 'StorageAccountUpdateParameters', + modelProperties: { + activeKeyName: { + required: false, + serializedName: 'activeKeyName', + type: { + name: 'String' + } + }, + autoRegenerateKey: { + required: false, + serializedName: 'autoRegenerateKey', + type: { + name: 'Boolean' + } + }, + regenerationPeriod: { + required: false, + serializedName: 'regenerationPeriod', + type: { + name: 'String' + } + }, + storageAccountAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = StorageAccountUpdateParameters; diff --git a/lib/services/keyvault/lib/models/storageBundle.js b/lib/services/keyvault/lib/models/storageBundle.js new file mode 100644 index 0000000000..c8110b9d2d --- /dev/null +++ b/lib/services/keyvault/lib/models/storageBundle.js @@ -0,0 +1,130 @@ +/* + * 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'; + +/** + * A Storage account bundle consists of key vault storage account details plus + * its attributes. + * + */ +class StorageBundle { + /** + * Create a StorageBundle. + * @member {string} [id] The storage account id. + * @member {string} [resourceId] The storage account resource id. + * @member {string} [activeKeyName] The current active storage account key + * name. + * @member {boolean} [autoRegenerateKey] whether keyvault should manage the + * storage account for the user. + * @member {string} [regenerationPeriod] The key regeneration time duration + * specified in ISO-8601 format. + * @member {object} [attributes] The storage account attributes. + * @member {boolean} [attributes.enabled] the enabled state of the object. + * @member {date} [attributes.created] Creation time in UTC. + * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @member {object} [tags] Application specific metadata in the form of + * key-value pairs + */ + constructor() { + } + + /** + * Defines the metadata of StorageBundle + * + * @returns {object} metadata of StorageBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageBundle', + type: { + name: 'Composite', + className: 'StorageBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + readOnly: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + activeKeyName: { + required: false, + readOnly: true, + serializedName: 'activeKeyName', + type: { + name: 'String' + } + }, + autoRegenerateKey: { + required: false, + readOnly: true, + serializedName: 'autoRegenerateKey', + type: { + name: 'Boolean' + } + }, + regenerationPeriod: { + required: false, + readOnly: true, + serializedName: 'regenerationPeriod', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = StorageBundle; diff --git a/lib/services/keyvault/lib/models/storageListResult.js b/lib/services/keyvault/lib/models/storageListResult.js new file mode 100644 index 0000000000..82aa68f6f6 --- /dev/null +++ b/lib/services/keyvault/lib/models/storageListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The storage accounts list result. + */ +class StorageListResult extends Array { + /** + * Create a StorageListResult. + * @member {string} [nextLink] The URL to get the next set of storage + * accounts. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StorageListResult + * + * @returns {object} metadata of StorageListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageListResult', + type: { + name: 'Composite', + className: 'StorageListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StorageAccountItemElementType', + type: { + name: 'Composite', + className: 'StorageAccountItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = StorageListResult; diff --git a/lib/services/keyvault/lib/models/storageRestoreParameters.js b/lib/services/keyvault/lib/models/storageRestoreParameters.js new file mode 100644 index 0000000000..aaa159104a --- /dev/null +++ b/lib/services/keyvault/lib/models/storageRestoreParameters.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The secret restore parameters. + * + */ +class StorageRestoreParameters { + /** + * Create a StorageRestoreParameters. + * @member {buffer} storageBundleBackup The backup blob associated with a + * storage account. + */ + constructor() { + } + + /** + * Defines the metadata of StorageRestoreParameters + * + * @returns {object} metadata of StorageRestoreParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageRestoreParameters', + type: { + name: 'Composite', + className: 'StorageRestoreParameters', + modelProperties: { + storageBundleBackup: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = StorageRestoreParameters; diff --git a/lib/services/keyvault/lib/models/subjectAlternativeNames.js b/lib/services/keyvault/lib/models/subjectAlternativeNames.js new file mode 100644 index 0000000000..c44fca670c --- /dev/null +++ b/lib/services/keyvault/lib/models/subjectAlternativeNames.js @@ -0,0 +1,89 @@ +/* + * 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 subject alternate names of a X509 object. + * + */ +class SubjectAlternativeNames { + /** + * Create a SubjectAlternativeNames. + * @member {array} [emails] Email addresses. + * @member {array} [dnsNames] Domain names. + * @member {array} [upns] User principal names. + */ + constructor() { + } + + /** + * Defines the metadata of SubjectAlternativeNames + * + * @returns {object} metadata of SubjectAlternativeNames + * + */ + mapper() { + return { + required: false, + serializedName: 'SubjectAlternativeNames', + type: { + name: 'Composite', + className: 'SubjectAlternativeNames', + modelProperties: { + emails: { + required: false, + serializedName: 'emails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + dnsNames: { + required: false, + serializedName: 'dns_names', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + upns: { + required: false, + serializedName: 'upns', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = SubjectAlternativeNames; diff --git a/lib/services/keyvault/lib/models/trigger.js b/lib/services/keyvault/lib/models/trigger.js new file mode 100644 index 0000000000..ac42f6e7da --- /dev/null +++ b/lib/services/keyvault/lib/models/trigger.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'; + +/** + * A condition to be satisfied for an action to be executed. + * + */ +class Trigger { + /** + * Create a Trigger. + * @member {number} [lifetimePercentage] Percentage of lifetime at which to + * trigger. Value should be between 1 and 99. + * @member {number} [daysBeforeExpiry] Days before expiry to attempt renewal. + * Value should be between 1 and validity_in_months multiplied by 27. If + * validity_in_months is 36, then value should be between 1 and 972 (36 * + * 27). + */ + constructor() { + } + + /** + * Defines the metadata of Trigger + * + * @returns {object} metadata of Trigger + * + */ + mapper() { + return { + required: false, + serializedName: 'Trigger', + type: { + name: 'Composite', + className: 'Trigger', + modelProperties: { + lifetimePercentage: { + required: false, + serializedName: 'lifetime_percentage', + constraints: { + InclusiveMaximum: 99, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + daysBeforeExpiry: { + required: false, + serializedName: 'days_before_expiry', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = Trigger; diff --git a/lib/services/keyvault/lib/models/x509CertificateProperties.js b/lib/services/keyvault/lib/models/x509CertificateProperties.js new file mode 100644 index 0000000000..3d50695370 --- /dev/null +++ b/lib/services/keyvault/lib/models/x509CertificateProperties.js @@ -0,0 +1,107 @@ +/* + * 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 of the X509 component of a certificate. + * + */ +class X509CertificateProperties { + /** + * Create a X509CertificateProperties. + * @member {string} [subject] The subject name. Should be a valid X509 + * distinguished Name. + * @member {array} [ekus] The enhanced key usage. + * @member {object} [subjectAlternativeNames] The subject alternative names. + * @member {array} [subjectAlternativeNames.emails] Email addresses. + * @member {array} [subjectAlternativeNames.dnsNames] Domain names. + * @member {array} [subjectAlternativeNames.upns] User principal names. + * @member {array} [keyUsage] List of key usages. + * @member {number} [validityInMonths] The duration that the ceritifcate is + * valid in months. + */ + constructor() { + } + + /** + * Defines the metadata of X509CertificateProperties + * + * @returns {object} metadata of X509CertificateProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'X509CertificateProperties', + type: { + name: 'Composite', + className: 'X509CertificateProperties', + modelProperties: { + subject: { + required: false, + serializedName: 'subject', + type: { + name: 'String' + } + }, + ekus: { + required: false, + serializedName: 'ekus', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + subjectAlternativeNames: { + required: false, + serializedName: 'sans', + type: { + name: 'Composite', + className: 'SubjectAlternativeNames' + } + }, + keyUsage: { + required: false, + serializedName: 'key_usage', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'KeyUsageTypeElementType', + type: { + name: 'String' + } + } + } + }, + validityInMonths: { + required: false, + serializedName: 'validity_months', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = X509CertificateProperties; diff --git a/lib/services/mediaServicesManagement/README.md b/lib/services/mediaServicesManagement/README.md index 7f4bd1ed4a..a341ba1297 100644 --- a/lib/services/mediaServicesManagement/README.md +++ b/lib/services/mediaServicesManagement/README.md @@ -18,7 +18,7 @@ npm install azure-arm-mediaservices ## How to use -### Authentication, client creation and list operations as an example. +### Authentication, client creation and list accountFilters as an example. ```javascript const msRestAzure = require("ms-rest-azure"); @@ -26,7 +26,9 @@ const AzureMediaServices = require("azure-arm-mediaservices"); msRestAzure.interactiveLogin().then((creds) => { const subscriptionId = ""; const client = new AzureMediaServices(creds, subscriptionId); - return client.operations.list().then((result) => { + const resourceGroupName = "testresourceGroupName"; + const accountName = "testaccountName"; + return client.accountFilters.list(resourceGroupName, accountName).then((result) => { console.log("The result is:"); console.log(result); }); diff --git a/lib/services/mediaServicesManagement/lib/azureMediaServices.d.ts b/lib/services/mediaServicesManagement/lib/azureMediaServices.d.ts index f4a40915f8..ba1fbab737 100644 --- a/lib/services/mediaServicesManagement/lib/azureMediaServices.d.ts +++ b/lib/services/mediaServicesManagement/lib/azureMediaServices.d.ts @@ -34,11 +34,11 @@ export default class AzureMediaServices extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -56,10 +56,12 @@ export default class AzureMediaServices extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + accountFilters: operations.AccountFilters; operations: operations.Operations; mediaservices: operations.Mediaservices; locations: operations.Locations; assets: operations.Assets; + assetFilters: operations.AssetFilters; contentKeyPolicies: operations.ContentKeyPolicies; transforms: operations.Transforms; jobs: operations.Jobs; diff --git a/lib/services/mediaServicesManagement/lib/azureMediaServices.js b/lib/services/mediaServicesManagement/lib/azureMediaServices.js index d00dd12ed6..1e514a6a1b 100644 --- a/lib/services/mediaServicesManagement/lib/azureMediaServices.js +++ b/lib/services/mediaServicesManagement/lib/azureMediaServices.js @@ -34,9 +34,9 @@ class AzureMediaServices extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -50,7 +50,7 @@ class AzureMediaServices extends ServiceClient { super(credentials, options); - this.apiVersion = '2018-06-01-preview'; + this.apiVersion = '2018-07-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -72,10 +72,12 @@ class AzureMediaServices extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.accountFilters = new operations.AccountFilters(this); this.operations = new operations.Operations(this); this.mediaservices = new operations.Mediaservices(this); this.locations = new operations.Locations(this); this.assets = new operations.Assets(this); + this.assetFilters = new operations.AssetFilters(this); this.contentKeyPolicies = new operations.ContentKeyPolicies(this); this.transforms = new operations.Transforms(this); this.jobs = new operations.Jobs(this); diff --git a/lib/services/mediaServicesManagement/lib/models/accountFilter.js b/lib/services/mediaServicesManagement/lib/models/accountFilter.js new file mode 100644 index 0000000000..282b206653 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/accountFilter.js @@ -0,0 +1,119 @@ +/* + * 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'); + +/** + * An Account Filter. + * + * @extends models['ProxyResource'] + */ +class AccountFilter extends models['ProxyResource'] { + /** + * Create a AccountFilter. + * @member {object} [presentationTimeRange] The presentation time range. + * @member {number} [presentationTimeRange.startTimestamp] The absolute start + * time boundary. + * @member {number} [presentationTimeRange.endTimestamp] The absolute end + * time boundary. + * @member {number} [presentationTimeRange.presentationWindowDuration] The + * relative to end sliding window. + * @member {number} [presentationTimeRange.liveBackoffDuration] The relative + * to end right edge. + * @member {number} [presentationTimeRange.timescale] The time scale of time + * stamps. + * @member {boolean} [presentationTimeRange.forceEndTimestamp] The indicator + * of forcing exsiting of end time stamp. + * @member {object} [firstQuality] The first quality. + * @member {number} [firstQuality.bitrate] The first quality bitrate. + * @member {array} [tracks] The tracks selection conditions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AccountFilter + * + * @returns {object} metadata of AccountFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'AccountFilter', + type: { + name: 'Composite', + className: 'AccountFilter', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + presentationTimeRange: { + required: false, + serializedName: 'properties.presentationTimeRange', + type: { + name: 'Composite', + className: 'PresentationTimeRange' + } + }, + firstQuality: { + required: false, + serializedName: 'properties.firstQuality', + type: { + name: 'Composite', + className: 'FirstQuality' + } + }, + tracks: { + required: false, + serializedName: 'properties.tracks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FilterTrackSelectionElementType', + type: { + name: 'Composite', + className: 'FilterTrackSelection' + } + } + } + } + } + } + }; + } +} + +module.exports = AccountFilter; diff --git a/lib/services/mediaServicesManagement/lib/models/accountFilterCollection.js b/lib/services/mediaServicesManagement/lib/models/accountFilterCollection.js new file mode 100644 index 0000000000..210b556327 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/accountFilterCollection.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'; + +/** + * A collection of AccountFilter items. + */ +class AccountFilterCollection extends Array { + /** + * Create a AccountFilterCollection. + * @member {string} [odatanextLink] A link to the next page of the collection + * (when the collection contains too many results to return in one response). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AccountFilterCollection + * + * @returns {object} metadata of AccountFilterCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'AccountFilterCollection', + type: { + name: 'Composite', + className: 'AccountFilterCollection', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AccountFilterElementType', + type: { + name: 'Composite', + className: 'AccountFilter' + } + } + } + }, + odatanextLink: { + required: false, + serializedName: '@odata\\.nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AccountFilterCollection; diff --git a/lib/services/mediaServicesManagement/lib/models/akamaiAccessControl.js b/lib/services/mediaServicesManagement/lib/models/akamaiAccessControl.js index 35d0e4e252..db629466fb 100644 --- a/lib/services/mediaServicesManagement/lib/models/akamaiAccessControl.js +++ b/lib/services/mediaServicesManagement/lib/models/akamaiAccessControl.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Akamai access control * diff --git a/lib/services/mediaServicesManagement/lib/models/akamaiSignatureHeaderAuthenticationKey.js b/lib/services/mediaServicesManagement/lib/models/akamaiSignatureHeaderAuthenticationKey.js index abc27eac0c..2bd9ed32f6 100644 --- a/lib/services/mediaServicesManagement/lib/models/akamaiSignatureHeaderAuthenticationKey.js +++ b/lib/services/mediaServicesManagement/lib/models/akamaiSignatureHeaderAuthenticationKey.js @@ -19,7 +19,7 @@ class AkamaiSignatureHeaderAuthenticationKey { * Create a AkamaiSignatureHeaderAuthenticationKey. * @member {string} [identifier] identifier of the key * @member {string} [base64Key] authentication key - * @member {date} [expiration] The exact time the authentication key. + * @member {date} [expiration] The expiration time of the authentication key. */ constructor() { } diff --git a/lib/services/mediaServicesManagement/lib/models/apiError.js b/lib/services/mediaServicesManagement/lib/models/apiError.js index 20ddeb52a1..c46090683e 100644 --- a/lib/services/mediaServicesManagement/lib/models/apiError.js +++ b/lib/services/mediaServicesManagement/lib/models/apiError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The API error. * @@ -19,7 +17,7 @@ const models = require('./index'); class ApiError { /** * Create a ApiError. - * @member {object} [error] The error properties. + * @member {object} [error] ApiError. The error properties. * @member {string} [error.code] A language-independent error name. * @member {string} [error.message] The error message. * @member {string} [error.target] The target of the error (for example, the diff --git a/lib/services/mediaServicesManagement/lib/models/asset.js b/lib/services/mediaServicesManagement/lib/models/asset.js index 9f65fcaf1e..63876ee283 100644 --- a/lib/services/mediaServicesManagement/lib/models/asset.js +++ b/lib/services/mediaServicesManagement/lib/models/asset.js @@ -75,6 +75,7 @@ class Asset extends models['ProxyResource'] { }, assetId: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.assetId', type: { @@ -83,6 +84,7 @@ class Asset extends models['ProxyResource'] { }, created: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.created', type: { @@ -91,6 +93,7 @@ class Asset extends models['ProxyResource'] { }, lastModified: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModified', type: { @@ -127,6 +130,7 @@ class Asset extends models['ProxyResource'] { }, storageEncryptionFormat: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.storageEncryptionFormat', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/assetFileEncryptionMetadata.js b/lib/services/mediaServicesManagement/lib/models/assetFileEncryptionMetadata.js new file mode 100644 index 0000000000..127d6e784c --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/assetFileEncryptionMetadata.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'; + +/** + * The Asset File Storage encryption metadata. + * + */ +class AssetFileEncryptionMetadata { + /** + * Create a AssetFileEncryptionMetadata. + * @member {string} [initializationVector] The Asset File initialization + * vector. + * @member {string} [assetFileName] The Asset File name. + * @member {uuid} assetFileId The Asset File Id. + */ + constructor() { + } + + /** + * Defines the metadata of AssetFileEncryptionMetadata + * + * @returns {object} metadata of AssetFileEncryptionMetadata + * + */ + mapper() { + return { + required: false, + serializedName: 'AssetFileEncryptionMetadata', + type: { + name: 'Composite', + className: 'AssetFileEncryptionMetadata', + modelProperties: { + initializationVector: { + required: false, + serializedName: 'initializationVector', + type: { + name: 'String' + } + }, + assetFileName: { + required: false, + serializedName: 'assetFileName', + type: { + name: 'String' + } + }, + assetFileId: { + required: true, + serializedName: 'assetFileId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AssetFileEncryptionMetadata; diff --git a/lib/services/mediaServicesManagement/lib/models/assetFilter.js b/lib/services/mediaServicesManagement/lib/models/assetFilter.js new file mode 100644 index 0000000000..456a6c18f8 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/assetFilter.js @@ -0,0 +1,119 @@ +/* + * 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'); + +/** + * An Asset Filter. + * + * @extends models['ProxyResource'] + */ +class AssetFilter extends models['ProxyResource'] { + /** + * Create a AssetFilter. + * @member {object} [presentationTimeRange] The presentation time range. + * @member {number} [presentationTimeRange.startTimestamp] The absolute start + * time boundary. + * @member {number} [presentationTimeRange.endTimestamp] The absolute end + * time boundary. + * @member {number} [presentationTimeRange.presentationWindowDuration] The + * relative to end sliding window. + * @member {number} [presentationTimeRange.liveBackoffDuration] The relative + * to end right edge. + * @member {number} [presentationTimeRange.timescale] The time scale of time + * stamps. + * @member {boolean} [presentationTimeRange.forceEndTimestamp] The indicator + * of forcing exsiting of end time stamp. + * @member {object} [firstQuality] The first quality. + * @member {number} [firstQuality.bitrate] The first quality bitrate. + * @member {array} [tracks] The tracks selection conditions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AssetFilter + * + * @returns {object} metadata of AssetFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'AssetFilter', + type: { + name: 'Composite', + className: 'AssetFilter', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + presentationTimeRange: { + required: false, + serializedName: 'properties.presentationTimeRange', + type: { + name: 'Composite', + className: 'PresentationTimeRange' + } + }, + firstQuality: { + required: false, + serializedName: 'properties.firstQuality', + type: { + name: 'Composite', + className: 'FirstQuality' + } + }, + tracks: { + required: false, + serializedName: 'properties.tracks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FilterTrackSelectionElementType', + type: { + name: 'Composite', + className: 'FilterTrackSelection' + } + } + } + } + } + } + }; + } +} + +module.exports = AssetFilter; diff --git a/lib/services/mediaServicesManagement/lib/models/assetFilterCollection.js b/lib/services/mediaServicesManagement/lib/models/assetFilterCollection.js new file mode 100644 index 0000000000..3f3f0ec041 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/assetFilterCollection.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'; + +/** + * A collection of AssetFilter items. + */ +class AssetFilterCollection extends Array { + /** + * Create a AssetFilterCollection. + * @member {string} [odatanextLink] A link to the next page of the collection + * (when the collection contains too many results to return in one response). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AssetFilterCollection + * + * @returns {object} metadata of AssetFilterCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'AssetFilterCollection', + type: { + name: 'Composite', + className: 'AssetFilterCollection', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AssetFilterElementType', + type: { + name: 'Composite', + className: 'AssetFilter' + } + } + } + }, + odatanextLink: { + required: false, + serializedName: '@odata\\.nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AssetFilterCollection; diff --git a/lib/services/mediaServicesManagement/lib/models/assetStreamingLocator.js b/lib/services/mediaServicesManagement/lib/models/assetStreamingLocator.js new file mode 100644 index 0000000000..df4bd4ee21 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/assetStreamingLocator.js @@ -0,0 +1,123 @@ +/* + * 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 of the Streaming Locator. + * + */ +class AssetStreamingLocator { + /** + * Create a AssetStreamingLocator. + * @member {string} [name] Streaming Locator name. + * @member {string} [assetName] Asset Name. + * @member {date} [created] The creation time of the Streaming Locator. + * @member {date} [startTime] The start time of the Streaming Locator. + * @member {date} [endTime] The end time of the Streaming Locator. + * @member {uuid} [streamingLocatorId] StreamingLocatorId of the Streaming + * Locator. + * @member {string} [streamingPolicyName] Name of the Streaming Policy used + * by this Streaming Locator. + * @member {string} [defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. + */ + constructor() { + } + + /** + * Defines the metadata of AssetStreamingLocator + * + * @returns {object} metadata of AssetStreamingLocator + * + */ + mapper() { + return { + required: false, + serializedName: 'AssetStreamingLocator', + type: { + name: 'Composite', + className: 'AssetStreamingLocator', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + assetName: { + required: false, + readOnly: true, + serializedName: 'assetName', + type: { + name: 'String' + } + }, + created: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'DateTime' + } + }, + startTime: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + streamingLocatorId: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'streamingLocatorId', + type: { + name: 'String' + } + }, + streamingPolicyName: { + required: false, + readOnly: true, + serializedName: 'streamingPolicyName', + type: { + name: 'String' + } + }, + defaultContentKeyPolicyName: { + required: false, + readOnly: true, + serializedName: 'defaultContentKeyPolicyName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AssetStreamingLocator; diff --git a/lib/services/mediaServicesManagement/lib/models/audioAnalyzerPreset.js b/lib/services/mediaServicesManagement/lib/models/audioAnalyzerPreset.js index 5d434bc75a..af9c404eb7 100644 --- a/lib/services/mediaServicesManagement/lib/models/audioAnalyzerPreset.js +++ b/lib/services/mediaServicesManagement/lib/models/audioAnalyzerPreset.js @@ -25,7 +25,13 @@ class AudioAnalyzerPreset extends models['Preset'] { * @member {string} [audioLanguage] The language for the audio payload in the * input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The * list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', - * 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN'. + * 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', + * 'hi-IN'. If not specified, automatic language detection would be employed. + * This feature currently supports English, Chinese, French, German, Italian, + * Japanese, Spanish, Russian, and Portuguese. The automatic detection works + * best with audio recordings with clearly discernable speech. If automatic + * detection fails to find the language, transcription would fallback to + * English. */ constructor() { super(); diff --git a/lib/services/mediaServicesManagement/lib/models/builtInStandardEncoderPreset.js b/lib/services/mediaServicesManagement/lib/models/builtInStandardEncoderPreset.js index 4dc1a622eb..3b0aee1b41 100644 --- a/lib/services/mediaServicesManagement/lib/models/builtInStandardEncoderPreset.js +++ b/lib/services/mediaServicesManagement/lib/models/builtInStandardEncoderPreset.js @@ -22,7 +22,8 @@ class BuiltInStandardEncoderPreset extends models['Preset'] { /** * Create a BuiltInStandardEncoderPreset. * @member {string} presetName The built-in preset to be used for encoding - * videos. Possible values include: 'AdaptiveStreaming', + * videos. Possible values include: 'H264SingleBitrateSD', + * 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', * 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', * 'H264MultipleBitrate720p', 'H264MultipleBitrateSD' */ @@ -62,7 +63,7 @@ class BuiltInStandardEncoderPreset extends models['Preset'] { serializedName: 'presetName', type: { name: 'Enum', - allowedValues: [ 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD' ] + allowedValues: [ 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD' ] } } } diff --git a/lib/services/mediaServicesManagement/lib/models/cbcsDrmConfiguration.js b/lib/services/mediaServicesManagement/lib/models/cbcsDrmConfiguration.js index 746146424d..fd53711b80 100644 --- a/lib/services/mediaServicesManagement/lib/models/cbcsDrmConfiguration.js +++ b/lib/services/mediaServicesManagement/lib/models/cbcsDrmConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class to specify DRM configurations of CommonEncryptionCbcs scheme in * Streaming Policy diff --git a/lib/services/mediaServicesManagement/lib/models/cencDrmConfiguration.js b/lib/services/mediaServicesManagement/lib/models/cencDrmConfiguration.js index 9423f287aa..71e8e992a5 100644 --- a/lib/services/mediaServicesManagement/lib/models/cencDrmConfiguration.js +++ b/lib/services/mediaServicesManagement/lib/models/cencDrmConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class to specify DRM configurations of CommonEncryptionCenc scheme in * Streaming Policy diff --git a/lib/services/mediaServicesManagement/lib/models/commonEncryptionCbcs.js b/lib/services/mediaServicesManagement/lib/models/commonEncryptionCbcs.js index 8a3e1ee426..5699c74024 100644 --- a/lib/services/mediaServicesManagement/lib/models/commonEncryptionCbcs.js +++ b/lib/services/mediaServicesManagement/lib/models/commonEncryptionCbcs.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class for CommonEncryptionCbcs encryption scheme * diff --git a/lib/services/mediaServicesManagement/lib/models/commonEncryptionCenc.js b/lib/services/mediaServicesManagement/lib/models/commonEncryptionCenc.js index 3b409e61df..8b95457158 100644 --- a/lib/services/mediaServicesManagement/lib/models/commonEncryptionCenc.js +++ b/lib/services/mediaServicesManagement/lib/models/commonEncryptionCenc.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class for envelope encryption scheme * diff --git a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicy.js b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicy.js index dd445c3f0d..96cbab4094 100644 --- a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicy.js +++ b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicy.js @@ -70,6 +70,7 @@ class ContentKeyPolicy extends models['ProxyResource'] { }, policyId: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.policyId', type: { @@ -78,6 +79,7 @@ class ContentKeyPolicy extends models['ProxyResource'] { }, created: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.created', type: { @@ -86,6 +88,7 @@ class ContentKeyPolicy extends models['ProxyResource'] { }, lastModified: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModified', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyFairPlayConfiguration.js b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyFairPlayConfiguration.js index 1849186b05..6b38bb138f 100644 --- a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyFairPlayConfiguration.js +++ b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyFairPlayConfiguration.js @@ -20,7 +20,8 @@ const models = require('./index'); class ContentKeyPolicyFairPlayConfiguration extends models['ContentKeyPolicyConfiguration'] { /** * Create a ContentKeyPolicyFairPlayConfiguration. - * @member {buffer} ask The key that must be used as FairPlay ASk. + * @member {buffer} ask The key that must be used as FairPlay Application + * Secret key. * @member {string} fairPlayPfxPassword The password encrypting FairPlay * certificate in PKCS 12 (pfx) format. * @member {string} fairPlayPfx The Base64 representation of FairPlay diff --git a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyOption.js b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyOption.js index c3ff325f72..87f967d262 100644 --- a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyOption.js +++ b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyOption.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents a policy option. * @@ -46,6 +44,7 @@ class ContentKeyPolicyOption { modelProperties: { policyOptionId: { required: false, + nullable: false, readOnly: true, serializedName: 'policyOptionId', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyPlayReadyLicense.js b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyPlayReadyLicense.js index 5571cce6e5..52d3eb2f8c 100644 --- a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyPlayReadyLicense.js +++ b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyPlayReadyLicense.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The PlayReady license * diff --git a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyPlayReadyPlayRight.js b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyPlayReadyPlayRight.js index 6acd466d78..218ccc99c8 100644 --- a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyPlayReadyPlayRight.js +++ b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyPlayReadyPlayRight.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Configures the Play Right in the PlayReady license. * diff --git a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyProperties.js b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyProperties.js index f6111d3a8c..e02821c4a1 100644 --- a/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyProperties.js +++ b/lib/services/mediaServicesManagement/lib/models/contentKeyPolicyProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties of the Content Key Policy. * @@ -44,6 +42,7 @@ class ContentKeyPolicyProperties { modelProperties: { policyId: { required: false, + nullable: false, readOnly: true, serializedName: 'policyId', type: { @@ -52,6 +51,7 @@ class ContentKeyPolicyProperties { }, created: { required: false, + nullable: false, readOnly: true, serializedName: 'created', type: { @@ -60,6 +60,7 @@ class ContentKeyPolicyProperties { }, lastModified: { required: false, + nullable: false, readOnly: true, serializedName: 'lastModified', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/envelopeEncryption.js b/lib/services/mediaServicesManagement/lib/models/envelopeEncryption.js index 2cc9ff86d0..2e32c524b2 100644 --- a/lib/services/mediaServicesManagement/lib/models/envelopeEncryption.js +++ b/lib/services/mediaServicesManagement/lib/models/envelopeEncryption.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class for EnvelopeEncryption encryption scheme * diff --git a/lib/services/mediaServicesManagement/lib/models/filterTrackPropertyCondition.js b/lib/services/mediaServicesManagement/lib/models/filterTrackPropertyCondition.js new file mode 100644 index 0000000000..a4292b858f --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/filterTrackPropertyCondition.js @@ -0,0 +1,72 @@ +/* + * 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 class to specify one track property condition. + * + */ +class FilterTrackPropertyCondition { + /** + * Create a FilterTrackPropertyCondition. + * @member {string} property The track property type. Possible values + * include: 'Unknown', 'Type', 'Name', 'Language', 'FourCC', 'Bitrate' + * @member {string} value The track proprty value. + * @member {string} operation The track property condition operation. + * Possible values include: 'Equal', 'NotEqual' + */ + constructor() { + } + + /** + * Defines the metadata of FilterTrackPropertyCondition + * + * @returns {object} metadata of FilterTrackPropertyCondition + * + */ + mapper() { + return { + required: false, + serializedName: 'FilterTrackPropertyCondition', + type: { + name: 'Composite', + className: 'FilterTrackPropertyCondition', + modelProperties: { + property: { + required: true, + serializedName: 'property', + type: { + name: 'Enum', + allowedValues: [ 'Unknown', 'Type', 'Name', 'Language', 'FourCC', 'Bitrate' ] + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + operation: { + required: true, + serializedName: 'operation', + type: { + name: 'Enum', + allowedValues: [ 'Equal', 'NotEqual' ] + } + } + } + } + }; + } +} + +module.exports = FilterTrackPropertyCondition; diff --git a/lib/services/mediaServicesManagement/lib/models/filterTrackSelection.js b/lib/services/mediaServicesManagement/lib/models/filterTrackSelection.js new file mode 100644 index 0000000000..dbf25b4c31 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/filterTrackSelection.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Representing a list of FilterTrackPropertyConditions to select a track. The + * filters are combined using a logical AND operation. + * + */ +class FilterTrackSelection { + /** + * Create a FilterTrackSelection. + * @member {array} trackSelections The track selections. + */ + constructor() { + } + + /** + * Defines the metadata of FilterTrackSelection + * + * @returns {object} metadata of FilterTrackSelection + * + */ + mapper() { + return { + required: false, + serializedName: 'FilterTrackSelection', + type: { + name: 'Composite', + className: 'FilterTrackSelection', + modelProperties: { + trackSelections: { + required: true, + serializedName: 'trackSelections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FilterTrackPropertyConditionElementType', + type: { + name: 'Composite', + className: 'FilterTrackPropertyCondition' + } + } + } + } + } + } + }; + } +} + +module.exports = FilterTrackSelection; diff --git a/lib/services/mediaServicesManagement/lib/models/filters.js b/lib/services/mediaServicesManagement/lib/models/filters.js index c2b26955aa..3851a50e6b 100644 --- a/lib/services/mediaServicesManagement/lib/models/filters.js +++ b/lib/services/mediaServicesManagement/lib/models/filters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes all the filtering operations, such as de-interlacing, rotation * etc. that are to be applied to the input media before encoding. diff --git a/lib/services/mediaServicesManagement/lib/models/firstQuality.js b/lib/services/mediaServicesManagement/lib/models/firstQuality.js new file mode 100644 index 0000000000..e70ed2d75d --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/firstQuality.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Filter First Quality + * + */ +class FirstQuality { + /** + * Create a FirstQuality. + * @member {number} bitrate The first quality bitrate. + */ + constructor() { + } + + /** + * Defines the metadata of FirstQuality + * + * @returns {object} metadata of FirstQuality + * + */ + mapper() { + return { + required: false, + serializedName: 'FirstQuality', + type: { + name: 'Composite', + className: 'FirstQuality', + modelProperties: { + bitrate: { + required: true, + serializedName: 'bitrate', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = FirstQuality; diff --git a/lib/services/mediaServicesManagement/lib/models/iPAccessControl.js b/lib/services/mediaServicesManagement/lib/models/iPAccessControl.js index 559fa97a4f..f727f4ab2d 100644 --- a/lib/services/mediaServicesManagement/lib/models/iPAccessControl.js +++ b/lib/services/mediaServicesManagement/lib/models/iPAccessControl.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The IP access control. * diff --git a/lib/services/mediaServicesManagement/lib/models/index.d.ts b/lib/services/mediaServicesManagement/lib/models/index.d.ts index 39cccc113f..eeb96c7098 100644 --- a/lib/services/mediaServicesManagement/lib/models/index.d.ts +++ b/lib/services/mediaServicesManagement/lib/models/index.d.ts @@ -16,6 +16,179 @@ export { BaseResource } from 'ms-rest-azure'; export { CloudError } from 'ms-rest-azure'; +/** + * @class + * Initializes a new instance of the PresentationTimeRange class. + * @constructor + * The presentation time range, this is asset related and not recommended for + * Account Filter. + * + * @member {number} startTimestamp The absolute start time boundary. + * @member {number} endTimestamp The absolute end time boundary. + * @member {number} presentationWindowDuration The relative to end sliding + * window. + * @member {number} liveBackoffDuration The relative to end right edge. + * @member {number} timescale The time scale of time stamps. + * @member {boolean} forceEndTimestamp The indicator of forcing exsiting of end + * time stamp. + */ +export interface PresentationTimeRange { + startTimestamp: number; + endTimestamp: number; + presentationWindowDuration: number; + liveBackoffDuration: number; + timescale: number; + forceEndTimestamp: boolean; +} + +/** + * @class + * Initializes a new instance of the FilterTrackPropertyCondition class. + * @constructor + * The class to specify one track property condition. + * + * @member {string} property The track property type. Possible values include: + * 'Unknown', 'Type', 'Name', 'Language', 'FourCC', 'Bitrate' + * @member {string} value The track proprty value. + * @member {string} operation The track property condition operation. Possible + * values include: 'Equal', 'NotEqual' + */ +export interface FilterTrackPropertyCondition { + property: string; + value: string; + operation: string; +} + +/** + * @class + * Initializes a new instance of the FirstQuality class. + * @constructor + * Filter First Quality + * + * @member {number} bitrate The first quality bitrate. + */ +export interface FirstQuality { + bitrate: number; +} + +/** + * @class + * Initializes a new instance of the FilterTrackSelection class. + * @constructor + * Representing a list of FilterTrackPropertyConditions to select a track. The + * filters are combined using a logical AND operation. + * + * @member {array} trackSelections The track selections. + */ +export interface FilterTrackSelection { + trackSelections: FilterTrackPropertyCondition[]; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * The core properties of ARM resources. + * + * @member {string} [id] Fully qualified resource ID for the resource. + * @member {string} [name] The name of the resource. + * @member {string} [type] The type of the resource. + */ +export interface Resource extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the ProxyResource class. + * @constructor + * The resource model definition for a ARM proxy resource. + * + */ +export interface ProxyResource extends Resource { +} + +/** + * @class + * Initializes a new instance of the AccountFilter class. + * @constructor + * An Account Filter. + * + * @member {object} [presentationTimeRange] The presentation time range. + * @member {number} [presentationTimeRange.startTimestamp] The absolute start + * time boundary. + * @member {number} [presentationTimeRange.endTimestamp] The absolute end time + * boundary. + * @member {number} [presentationTimeRange.presentationWindowDuration] The + * relative to end sliding window. + * @member {number} [presentationTimeRange.liveBackoffDuration] The relative to + * end right edge. + * @member {number} [presentationTimeRange.timescale] The time scale of time + * stamps. + * @member {boolean} [presentationTimeRange.forceEndTimestamp] The indicator of + * forcing exsiting of end time stamp. + * @member {object} [firstQuality] The first quality. + * @member {number} [firstQuality.bitrate] The first quality bitrate. + * @member {array} [tracks] The tracks selection conditions. + */ +export interface AccountFilter extends ProxyResource { + presentationTimeRange?: PresentationTimeRange; + firstQuality?: FirstQuality; + tracks?: FilterTrackSelection[]; +} + +/** + * @class + * Initializes a new instance of the ODataError class. + * @constructor + * Information about an error. + * + * @member {string} [code] A language-independent error name. + * @member {string} [message] The error message. + * @member {string} [target] The target of the error (for example, the name of + * the property in error). + * @member {array} [details] The error details. + */ +export interface ODataError { + code?: string; + message?: string; + target?: string; + details?: ODataError[]; +} + +/** + * @class + * Initializes a new instance of the ApiError class. + * @constructor + * The API error. + * + * @member {object} [error] ApiError. The error properties. + * @member {string} [error.code] A language-independent error name. + * @member {string} [error.message] The error message. + * @member {string} [error.target] The target of the error (for example, the + * name of the property in error). + * @member {array} [error.details] The error details. + */ +export interface ApiError { + error?: ODataError; +} + +/** + * @class + * Initializes a new instance of the TrackedResource class. + * @constructor + * The resource model definition for a ARM tracked resource. + * + * @member {object} [tags] Resource tags. + * @member {string} [location] The Azure Region of the resource. + */ +export interface TrackedResource extends Resource { + tags?: { [propertyName: string]: string }; + location?: string; +} + /** * @class * Initializes a new instance of the Provider class. @@ -46,6 +219,73 @@ export interface OperationDisplay { description?: string; } +/** + * @class + * Initializes a new instance of the MetricDimension class. + * @constructor + * A metric dimension. + * + * @member {string} [name] The metric dimension name. + * @member {string} [displayName] The display name for the dimension. + * @member {boolean} [toBeExportedForShoebox] Whether to export metric to + * shoebox. + */ +export interface MetricDimension { + readonly name?: string; + readonly displayName?: string; + readonly toBeExportedForShoebox?: boolean; +} + +/** + * @class + * Initializes a new instance of the Metric class. + * @constructor + * A metric emitted by service. + * + * @member {string} [name] The metric name. + * @member {string} [displayName] The metric display name. + * @member {string} [displayDescription] The metric display description. + * @member {string} [unit] The metric unit. Possible values include: 'Bytes', + * 'Count', 'Milliseconds' + * @member {string} [aggregationType] The metric aggregation type. Possible + * values include: 'Average', 'Count', 'Total' + * @member {array} [dimensions] The metric dimensions. + */ +export interface Metric { + readonly name?: string; + readonly displayName?: string; + readonly displayDescription?: string; + readonly unit?: string; + readonly aggregationType?: string; + readonly dimensions?: MetricDimension[]; +} + +/** + * @class + * Initializes a new instance of the ServiceSpecification class. + * @constructor + * The service metric specifications. + * + * @member {array} [metricSpecifications] List of metric specifications. + */ +export interface ServiceSpecification { + readonly metricSpecifications?: Metric[]; +} + +/** + * @class + * Initializes a new instance of the MetricProperties class. + * @constructor + * Metric properties. + * + * @member {object} [serviceSpecification] The service specifications. + * @member {array} [serviceSpecification.metricSpecifications] List of metric + * specifications. + */ +export interface MetricProperties { + readonly serviceSpecification?: ServiceSpecification; +} + /** * @class * Initializes a new instance of the Operation class. @@ -59,10 +299,18 @@ export interface OperationDisplay { * performed. * @member {string} [display.operation] The operation type. * @member {string} [display.description] The operation description. + * @member {string} [origin] Origin of the operation. + * @member {object} [properties] Operation properties format. + * @member {object} [properties.serviceSpecification] The service + * specifications. + * @member {array} [properties.serviceSpecification.metricSpecifications] List + * of metric specifications. */ export interface Operation { name: string; display?: OperationDisplay; + origin?: string; + properties?: MetricProperties; } /** @@ -123,36 +371,6 @@ export interface SyncStorageKeysInput { id?: string; } -/** - * @class - * Initializes a new instance of the Resource class. - * @constructor - * The core properties of ARM resources. - * - * @member {string} [id] Fully qualified resource ID for the resource. - * @member {string} [name] The name of the resource. - * @member {string} [type] The type of the resource. - */ -export interface Resource extends BaseResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; -} - -/** - * @class - * Initializes a new instance of the TrackedResource class. - * @constructor - * The resource model definition for a ARM tracked resource. - * - * @member {object} [tags] Resource tags. - * @member {string} [location] The Azure Region of the resource. - */ -export interface TrackedResource extends Resource { - tags?: { [propertyName: string]: string }; - location?: string; -} - /** * @class * Initializes a new instance of the MediaService class. @@ -183,88 +401,103 @@ export interface SubscriptionMediaService extends TrackedResource { /** * @class - * Initializes a new instance of the ODataError class. + * Initializes a new instance of the CheckNameAvailabilityInput class. * @constructor - * Information about an error. + * The input to the check name availability request. * - * @member {string} [code] A language-independent error name. - * @member {string} [message] The error message. - * @member {string} [target] The target of the error (for example, the name of - * the property in error). - * @member {array} [details] The error details. + * @member {string} [name] The account name. + * @member {string} [type] The account type. For a Media Services account, this + * should be 'MediaServices'. */ -export interface ODataError { - code?: string; - message?: string; - target?: string; - details?: ODataError[]; +export interface CheckNameAvailabilityInput { + name?: string; + type?: string; } /** * @class - * Initializes a new instance of the ApiError class. + * Initializes a new instance of the AssetContainerSas class. * @constructor - * The API error. + * The Asset Storage container SAS URLs. * - * @member {object} [error] The error properties. - * @member {string} [error.code] A language-independent error name. - * @member {string} [error.message] The error message. - * @member {string} [error.target] The target of the error (for example, the - * name of the property in error). - * @member {array} [error.details] The error details. + * @member {array} [assetContainerSasUrls] The list of Asset container SAS + * URLs. */ -export interface ApiError { - error?: ODataError; +export interface AssetContainerSas { + assetContainerSasUrls?: string[]; } /** * @class - * Initializes a new instance of the CheckNameAvailabilityInput class. + * Initializes a new instance of the AssetFileEncryptionMetadata class. * @constructor - * The input to the check name availability request. + * The Asset File Storage encryption metadata. * - * @member {string} [name] The account name. - * @member {string} [type] The account type. For a Media Services account, this - * should be 'MediaServices'. + * @member {string} [initializationVector] The Asset File initialization + * vector. + * @member {string} [assetFileName] The Asset File name. + * @member {uuid} assetFileId The Asset File Id. */ -export interface CheckNameAvailabilityInput { - name?: string; - type?: string; +export interface AssetFileEncryptionMetadata { + initializationVector?: string; + assetFileName?: string; + assetFileId: string; } /** * @class - * Initializes a new instance of the ProxyResource class. + * Initializes a new instance of the StorageEncryptedAssetDecryptionData class. * @constructor - * The resource model definition for a ARM proxy resource. + * Data needed to decrypt asset files encrypted with legacy storage encryption. * + * @member {buffer} [key] The Asset File storage encryption key. + * @member {array} [assetFileEncryptionMetadata] Asset File encryption + * metadata. */ -export interface ProxyResource extends Resource { +export interface StorageEncryptedAssetDecryptionData { + key?: Buffer; + assetFileEncryptionMetadata?: AssetFileEncryptionMetadata[]; } /** * @class - * Initializes a new instance of the AssetContainerSas class. + * Initializes a new instance of the AssetStreamingLocator class. * @constructor - * The Asset Storage container SAS URLs. + * Properties of the Streaming Locator. * - * @member {array} [assetContainerSasUrls] The list of Asset container SAS - * URLs. + * @member {string} [name] Streaming Locator name. + * @member {string} [assetName] Asset Name. + * @member {date} [created] The creation time of the Streaming Locator. + * @member {date} [startTime] The start time of the Streaming Locator. + * @member {date} [endTime] The end time of the Streaming Locator. + * @member {uuid} [streamingLocatorId] StreamingLocatorId of the Streaming + * Locator. + * @member {string} [streamingPolicyName] Name of the Streaming Policy used by + * this Streaming Locator. + * @member {string} [defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. */ -export interface AssetContainerSas { - assetContainerSasUrls?: string[]; +export interface AssetStreamingLocator { + readonly name?: string; + readonly assetName?: string; + readonly created?: Date; + readonly startTime?: Date; + readonly endTime?: Date; + readonly streamingLocatorId?: string; + readonly streamingPolicyName?: string; + readonly defaultContentKeyPolicyName?: string; } /** * @class - * Initializes a new instance of the AssetStorageEncryptionKey class. + * Initializes a new instance of the ListStreamingLocatorsResponse class. * @constructor - * The Asset Storage encryption key. + * The Streaming Locators associated with this Asset. * - * @member {string} [storageEncryptionKey] The Asset storage encryption key. + * @member {array} [streamingLocators] The list of Streaming Locators. */ -export interface AssetStorageEncryptionKey { - storageEncryptionKey?: string; +export interface ListStreamingLocatorsResponse { + readonly streamingLocators?: AssetStreamingLocator[]; } /** @@ -295,11 +528,40 @@ export interface Asset extends ProxyResource { readonly storageEncryptionFormat?: string; } +/** + * @class + * Initializes a new instance of the AssetFilter class. + * @constructor + * An Asset Filter. + * + * @member {object} [presentationTimeRange] The presentation time range. + * @member {number} [presentationTimeRange.startTimestamp] The absolute start + * time boundary. + * @member {number} [presentationTimeRange.endTimestamp] The absolute end time + * boundary. + * @member {number} [presentationTimeRange.presentationWindowDuration] The + * relative to end sliding window. + * @member {number} [presentationTimeRange.liveBackoffDuration] The relative to + * end right edge. + * @member {number} [presentationTimeRange.timescale] The time scale of time + * stamps. + * @member {boolean} [presentationTimeRange.forceEndTimestamp] The indicator of + * forcing exsiting of end time stamp. + * @member {object} [firstQuality] The first quality. + * @member {number} [firstQuality.bitrate] The first quality bitrate. + * @member {array} [tracks] The tracks selection conditions. + */ +export interface AssetFilter extends ProxyResource { + presentationTimeRange?: PresentationTimeRange; + firstQuality?: FirstQuality; + tracks?: FilterTrackSelection[]; +} + /** * @class * Initializes a new instance of the ListContainerSasInput class. * @constructor - * The parameters to the list SAS requet. + * The parameters to the list SAS request. * * @member {string} [permissions] The permissions to set on the SAS URL. * Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete' @@ -692,7 +954,8 @@ export interface ContentKeyPolicyPlayReadyConfiguration extends ContentKeyPolicy * @constructor * Specifies a configuration for FairPlay licenses. * - * @member {buffer} ask The key that must be used as FairPlay ASk. + * @member {buffer} ask The key that must be used as FairPlay Application + * Secret key. * @member {string} fairPlayPfxPassword The password encrypting FairPlay * certificate in PKCS 12 (pfx) format. * @member {string} fairPlayPfx The Base64 representation of FairPlay @@ -842,7 +1105,13 @@ export interface AacAudio extends Audio { * @member {string} [audioLanguage] The language for the audio payload in the * input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The * list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', - * 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN'. + * 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', + * 'hi-IN'. If not specified, automatic language detection would be employed. + * This feature currently supports English, Chinese, French, German, Italian, + * Japanese, Spanish, Russian, and Portuguese. The automatic detection works + * best with audio recordings with clearly discernable speech. If automatic + * detection fails to find the language, transcription would fallback to + * English. */ export interface AudioAnalyzerPreset extends Preset { audioLanguage?: string; @@ -1327,9 +1596,10 @@ export interface PngImage extends Image { * Encoder. * * @member {string} presetName The built-in preset to be used for encoding - * videos. Possible values include: 'AdaptiveStreaming', 'AACGoodQualityAudio', - * 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', - * 'H264MultipleBitrateSD' + * videos. Possible values include: 'H264SingleBitrateSD', + * 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', + * 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', + * 'H264MultipleBitrate720p', 'H264MultipleBitrateSD' */ export interface BuiltInStandardEncoderPreset extends Preset { presetName: string; @@ -1386,11 +1656,14 @@ export interface StandardEncoderPreset extends Preset { * A video analyzer preset that extracts insights (rich metadata) from both * audio and video, and outputs a JSON format file. * - * @member {boolean} [audioInsightsOnly] Whether to only extract audio insights - * when processing a video file. + * @member {string} [insightsToExtract] The type of insights to be extracted. + * If not set then based on the content the type will selected. If the content + * is audi only then only audio insights are extraced and if it is video only. + * Possible values include: 'AudioInsightsOnly', 'VideoInsightsOnly', + * 'AllInsights' */ export interface VideoAnalyzerPreset extends AudioAnalyzerPreset { - audioInsightsOnly?: boolean; + insightsToExtract?: string; } /** @@ -1457,7 +1730,9 @@ export interface VideoOverlay extends Overlay { * @member {string} [onError] A Transform can define more than one outputs. * This property defines what the service should do when one output fails - * either continue to produce other outputs, or, stop the other outputs. The - * default is stop. Possible values include: 'StopProcessingJob', 'ContinueJob' + * overall Job state will not reflect failures of outputs that are specified + * with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values + * include: 'StopProcessingJob', 'ContinueJob' * @member {string} [relativePriority] Sets the relative priority of the * TransformOutputs within a Transform. This sets the priority that the service * uses for processing TransformOutputs. The default priority is Normal. @@ -1504,16 +1779,9 @@ export interface Transform extends ProxyResource { * @constructor * Base class for inputs to a Job. * - * @member {string} [label] A label that is assigned to a JobInput, that is - * used to satisfy a reference used in the Transform. For example, a Transform - * can be authored so as to take an image file with the label 'xyz' and apply - * it as an overlay onto the input video before it is encoded. When submitting - * a Job, exactly one of the JobInputs should be the image file, and it should - * have the label 'xyz'. * @member {string} odatatype Polymorphic Discriminator */ export interface JobInput { - label?: string; odatatype: string; } @@ -1524,9 +1792,16 @@ export interface JobInput { * Represents input files for a Job. * * @member {array} [files] List of files. Required for JobInputHttp. + * @member {string} [label] A label that is assigned to a JobInputClip, that is + * used to satisfy a reference used in the Transform. For example, a Transform + * can be authored so as to take an image file with the label 'xyz' and apply + * it as an overlay onto the input video before it is encoded. When submitting + * a Job, exactly one of the JobInputs should be the image file, and it should + * have the label 'xyz'. */ export interface JobInputClip extends JobInput { files?: string[]; + label?: string; } /** @@ -1636,15 +1911,28 @@ export interface JobError { * values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', * 'Queued', 'Scheduled' * @member {number} [progress] If the JobOutput is in a Processing state, this - * contains the job completion percentage. The value is an estimate and not - * intended to be used to predict job completion times. To determine if the + * contains the Job completion percentage. The value is an estimate and not + * intended to be used to predict Job completion times. To determine if the * JobOutput is complete, use the State property. + * @member {string} [label] A label that is assigned to a JobOutput in order to + * help uniquely identify it. This is useful when your Transform has more than + * one TransformOutput, whereby your Job has more than one JobOutput. In such + * cases, when you submit the Job, you will add two or more JobOutputs, in the + * same order as TransformOutputs in the Transform. Subsequently, when you + * retrieve the Job, either through events or on a GET request, you can use the + * label to easily identify the JobOutput. If a label is not provided, a + * default value of '{presetName}_{outputIndex}' will be used, where the preset + * name is the name of the preset in the corresponding TransformOutput and the + * output index is the relative index of the this JobOutput within the Job. + * Note that this index is the same as the relative index of the corresponding + * TransformOutput within its Transform. * @member {string} odatatype Polymorphic Discriminator */ export interface JobOutput { readonly error?: JobError; readonly state?: string; readonly progress?: number; + label?: string; odatatype: string; } @@ -1675,12 +1963,6 @@ export interface JobOutputAsset extends JobOutput { * @member {string} [description] Optional customer supplied description of the * Job. * @member {object} input The inputs for the Job. - * @member {string} [input.label] A label that is assigned to a JobInput, that - * is used to satisfy a reference used in the Transform. For example, a - * Transform can be authored so as to take an image file with the label 'xyz' - * and apply it as an overlay onto the input video before it is encoded. When - * submitting a Job, exactly one of the JobInputs should be the image file, and - * it should have the label 'xyz'. * @member {string} [input.odatatype] Polymorphic Discriminator * @member {date} [lastModified] The UTC date and time when the Job was last * updated, in 'YYYY-MM-DDThh:mm:ssZ' format. @@ -1689,7 +1971,7 @@ export interface JobOutputAsset extends JobOutput { * Higher priority jobs are processed before lower priority jobs. If not set, * the default is normal. Possible values include: 'Low', 'Normal', 'High' * @member {object} [correlationData] Customer provided correlation data that - * will be returned in Job completed events. + * will be returned in Job and JobOutput state events. */ export interface Job extends ProxyResource { readonly created?: Date; @@ -2205,7 +2487,8 @@ export interface StreamingPolicy extends ProxyResource { * @member {string} [type] Encryption type of Content Key. Possible values * include: 'CommonEncryptionCenc', 'CommonEncryptionCbcs', * 'EnvelopeEncryption' - * @member {string} [label] Label of Content Key + * @member {string} [labelReferenceInStreamingPolicy] Label of Content Key as + * specified in the Streaming Policy * @member {string} [value] Value of of Content Key * @member {string} [policyName] ContentKeyPolicy used by Content Key * @member {array} [tracks] Tracks which use this Content Key @@ -2213,10 +2496,10 @@ export interface StreamingPolicy extends ProxyResource { export interface StreamingLocatorContentKey { id: string; readonly type?: string; - label?: string; + labelReferenceInStreamingPolicy?: string; value?: string; readonly policyName?: string; - tracks?: TrackSelection[]; + readonly tracks?: TrackSelection[]; } /** @@ -2274,26 +2557,24 @@ export interface ListPathsResponse { * A Streaming Locator resource * * @member {string} assetName Asset Name - * @member {date} [created] Creation time of Streaming Locator - * @member {date} [startTime] StartTime of Streaming Locator - * @member {date} [endTime] EndTime of Streaming Locator - * @member {uuid} [streamingLocatorId] StreamingLocatorId of Streaming Locator - * @member {string} streamingPolicyName Streaming policy name used by this - * streaming locator. Either specify the name of streaming policy you created - * or use one of the predefined streaming polices. The predefined streaming - * policies available are: 'Predefined_DownloadOnly', + * @member {date} [created] The creation time of the Streaming Locator. + * @member {date} [startTime] The start time of the Streaming Locator. + * @member {date} [endTime] The end time of the Streaming Locator. + * @member {uuid} [streamingLocatorId] The StreamingLocatorId of the Streaming + * Locator. + * @member {string} streamingPolicyName Name of the Streaming Policy used by + * this Streaming Locator. Either specify the name of Streaming Policy you + * created or use one of the predefined Streaming Policies. The predefined + * Streaming Policies available are: 'Predefined_DownloadOnly', * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', - * 'Predefined_ClearKey', 'Predefined_SecureStreaming' and - * 'Predefined_SecureStreamingWithFairPlay' - * @member {string} [defaultContentKeyPolicyName] Default ContentKeyPolicy used - * by this Streaming Locator - * @member {array} [contentKeys] ContentKeys used by this Streaming Locator - * @member {string} [alternativeMediaId] An Alternative Media Identifier - * associated with the StreamingLocator. This identifier can be used to - * distinguish different StreamingLocators for the same Asset for authorization - * purposes in the CustomLicenseAcquisitionUrlTemplate or the - * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the - * StreamingPolicyName field. + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming' + * @member {string} [defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. + * @member {array} [contentKeys] The ContentKeys used by this Streaming + * Locator. + * @member {string} [alternativeMediaId] Alternative Media ID of this Streaming + * Locator */ export interface StreamingLocator extends ProxyResource { assetName: string; @@ -2331,7 +2612,8 @@ export interface Hls { * @member {moment.duration} archiveWindowLength ISO 8601 timespan duration of * the archive window length. This is duration that customer want to retain the * recorded content. - * @member {string} [manifestName] The manifest file name. + * @member {string} [manifestName] The manifest file name. If not provided, + * the service will generate one automatically. * @member {object} [hls] The HLS configuration. * @member {number} [hls.fragmentsPerTsSegment] The amount of fragments per * HTTP Live Streaming (HLS) segment. @@ -2371,26 +2653,6 @@ export interface LiveEventEndpoint { url?: string; } -/** - * @class - * Initializes a new instance of the LiveEventInput class. - * @constructor - * The Live Event input. - * - * @member {string} streamingProtocol The streaming protocol for the Live - * Event. Possible values include: 'FragmentedMP4', 'RTMP' - * @member {string} [keyFrameIntervalDuration] ISO 8601 timespan duration of - * the key frame interval duration. - * @member {string} [accessToken] The access token. - * @member {array} [endpoints] The input endpoints for the Live Event. - */ -export interface LiveEventInput { - streamingProtocol: string; - keyFrameIntervalDuration?: string; - accessToken?: string; - endpoints?: LiveEventEndpoint[]; -} - /** * @class * Initializes a new instance of the IPRange class. @@ -2420,6 +2682,46 @@ export interface IPAccessControl { allow?: IPRange[]; } +/** + * @class + * Initializes a new instance of the LiveEventInputAccessControl class. + * @constructor + * The IP access control for Live Event Input. + * + * @member {object} [ip] The IP access control properties. + * @member {array} [ip.allow] The IP allow list. + */ +export interface LiveEventInputAccessControl { + ip?: IPAccessControl; +} + +/** + * @class + * Initializes a new instance of the LiveEventInput class. + * @constructor + * The Live Event input. + * + * @member {string} streamingProtocol The streaming protocol for the Live + * Event. This is specified at creation time and cannot be updated. Possible + * values include: 'FragmentedMP4', 'RTMP' + * @member {object} [accessControl] The access control for LiveEvent Input. + * @member {object} [accessControl.ip] The IP access control properties. + * @member {array} [accessControl.ip.allow] The IP allow list. + * @member {string} [keyFrameIntervalDuration] ISO 8601 timespan duration of + * the key frame interval duration. + * @member {string} [accessToken] A unique identifier for a stream. This can + * be specified at creation time but cannot be updated. If omitted, the + * service will generate a unique value. + * @member {array} [endpoints] The input endpoints for the Live Event. + */ +export interface LiveEventInput { + streamingProtocol: string; + accessControl?: LiveEventInputAccessControl; + keyFrameIntervalDuration?: string; + accessToken?: string; + endpoints?: LiveEventEndpoint[]; +} + /** * @class * Initializes a new instance of the LiveEventPreviewAccessControl class. @@ -2443,14 +2745,20 @@ export interface LiveEventPreviewAccessControl { * @member {object} [accessControl] The access control for LiveEvent preview. * @member {object} [accessControl.ip] The IP access control properties. * @member {array} [accessControl.ip.allow] The IP allow list. - * @member {string} [previewLocator] The preview locator Guid. + * @member {string} [previewLocator] The identifier of the preview locator in + * Guid format. Specifying this at creation time allows the caller to know the + * preview locator url before the event is created. If omitted, the service + * will generate a random identifier. This value cannot be updated once the + * live event is created. * @member {string} [streamingPolicyName] The name of streaming policy used for - * LiveEvent preview + * the LiveEvent preview. This value is specified at creation time and cannot + * be updated. * @member {string} [alternativeMediaId] An Alternative Media Identifier - * associated with the preview url. This identifier can be used to distinguish - * the preview of different live events for authorization purposes in the - * CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate - * of the StreamingPolicy specified in the StreamingPolicyName field. + * associated with the StreamingLocator created for the preview. This value is + * specified at creation time and cannot be updated. The identifier can be + * used in the CustomLicenseAcquisitionUrlTemplate or the + * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the + * StreamingPolicyName field. */ export interface LiveEventPreview { endpoints?: LiveEventEndpoint[]; @@ -2466,9 +2774,11 @@ export interface LiveEventPreview { * @constructor * The Live Event encoding. * - * @member {string} [encodingType] The encoding type for Live Event. Possible - * values include: 'None', 'Basic' - * @member {string} [presetName] The encoding preset name. + * @member {string} [encodingType] The encoding type for Live Event. This + * value is specified at creation time and cannot be updated. Possible values + * include: 'None', 'Basic' + * @member {string} [presetName] The encoding preset name. This value is + * specified at creation time and cannot be updated. */ export interface LiveEventEncoding { encodingType?: string; @@ -2513,10 +2823,17 @@ export interface LiveEventActionInput { * @member {string} [description] The Live Event description. * @member {object} input The Live Event input. * @member {string} [input.streamingProtocol] The streaming protocol for the - * Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * Live Event. This is specified at creation time and cannot be updated. + * Possible values include: 'FragmentedMP4', 'RTMP' + * @member {object} [input.accessControl] The access control for LiveEvent + * Input. + * @member {object} [input.accessControl.ip] The IP access control properties. + * @member {array} [input.accessControl.ip.allow] The IP allow list. * @member {string} [input.keyFrameIntervalDuration] ISO 8601 timespan duration * of the key frame interval duration. - * @member {string} [input.accessToken] The access token. + * @member {string} [input.accessToken] A unique identifier for a stream. This + * can be specified at creation time but cannot be updated. If omitted, the + * service will generate a unique value. * @member {array} [input.endpoints] The input endpoints for the Live Event. * @member {object} [preview] The Live Event preview. * @member {array} [preview.endpoints] The endpoints for preview. @@ -2525,19 +2842,26 @@ export interface LiveEventActionInput { * @member {object} [preview.accessControl.ip] The IP access control * properties. * @member {array} [preview.accessControl.ip.allow] The IP allow list. - * @member {string} [preview.previewLocator] The preview locator Guid. + * @member {string} [preview.previewLocator] The identifier of the preview + * locator in Guid format. Specifying this at creation time allows the caller + * to know the preview locator url before the event is created. If omitted, + * the service will generate a random identifier. This value cannot be updated + * once the live event is created. * @member {string} [preview.streamingPolicyName] The name of streaming policy - * used for LiveEvent preview + * used for the LiveEvent preview. This value is specified at creation time + * and cannot be updated. * @member {string} [preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * @member {object} [encoding] The Live Event encoding. * @member {string} [encoding.encodingType] The encoding type for Live Event. - * Possible values include: 'None', 'Basic' - * @member {string} [encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. Possible + * values include: 'None', 'Basic' + * @member {string} [encoding.presetName] The encoding preset name. This value + * is specified at creation time and cannot be updated. * @member {string} [provisioningState] The provisioning state of the Live * Event. * @member {string} [resourceState] The resource state of the Live Event. @@ -2548,8 +2872,10 @@ export interface LiveEventActionInput { * clientaccesspolicy.xml used by Silverlight. * @member {string} [crossSiteAccessPolicies.crossDomainPolicy] The content of * crossdomain.xml used by Silverlight. - * @member {boolean} [vanityUrl] The Live Event vanity URL flag. - * @member {array} [streamOptions] The stream options. + * @member {boolean} [vanityUrl] Specifies whether to use a vanity url with the + * Live Event. This value is specified at creation time and cannot be updated. + * @member {array} [streamOptions] The options to use for the LiveEvent. This + * value is specified at creation time and cannot be updated. * @member {date} [created] The exact time the Live Event was created. * @member {date} [lastModified] The exact time the Live Event was last * modified. @@ -2576,7 +2902,7 @@ export interface LiveEvent extends TrackedResource { * * @member {string} [identifier] identifier of the key * @member {string} [base64Key] authentication key - * @member {date} [expiration] The exact time the authentication key. + * @member {date} [expiration] The expiration time of the authentication key. */ export interface AkamaiSignatureHeaderAuthenticationKey { identifier?: string; @@ -2620,8 +2946,7 @@ export interface StreamingEndpointAccessControl { * @constructor * scale units definition * - * @member {number} [scaleUnit] ScaleUnit. The scale unit number of the - * StreamingEndpoint. + * @member {number} [scaleUnit] The scale unit number of the StreamingEndpoint. */ export interface StreamingEntityScaleUnit { scaleUnit?: number; @@ -2634,8 +2959,11 @@ export interface StreamingEntityScaleUnit { * The StreamingEndpoint. * * @member {string} [description] The StreamingEndpoint description. - * @member {number} [scaleUnits] The number of scale units. - * @member {string} [availabilitySetName] AvailabilitySet name + * @member {number} scaleUnits The number of scale units. Use the Scale + * operation to adjust this value. + * @member {string} [availabilitySetName] The name of the AvailabilitySet used + * with this StreamingEndpoint for high availability streaming. This value can + * only be set at creation time. * @member {object} [accessControl] The access control definition of the * StreamingEndpoint. * @member {object} [accessControl.akamai] The access control of Akamai @@ -2670,7 +2998,7 @@ export interface StreamingEntityScaleUnit { */ export interface StreamingEndpoint extends TrackedResource { description?: string; - scaleUnits?: number; + scaleUnits: number; availabilitySetName?: string; accessControl?: StreamingEndpointAccessControl; maxCacheAge?: number; @@ -2688,6 +3016,19 @@ export interface StreamingEndpoint extends TrackedResource { } +/** + * @class + * Initializes a new instance of the AccountFilterCollection class. + * @constructor + * A collection of AccountFilter items. + * + * @member {string} [odatanextLink] A link to the next page of the collection + * (when the collection contains too many results to return in one response). + */ +export interface AccountFilterCollection extends Array { + odatanextLink?: string; +} + /** * @class * Initializes a new instance of the OperationCollection class. @@ -2740,6 +3081,19 @@ export interface AssetCollection extends Array { odatanextLink?: string; } +/** + * @class + * Initializes a new instance of the AssetFilterCollection class. + * @constructor + * A collection of AssetFilter items. + * + * @member {string} [odatanextLink] A link to the next page of the collection + * (when the collection contains too many results to return in one response). + */ +export interface AssetFilterCollection extends Array { + odatanextLink?: string; +} + /** * @class * Initializes a new instance of the ContentKeyPolicyCollection class. diff --git a/lib/services/mediaServicesManagement/lib/models/index.js b/lib/services/mediaServicesManagement/lib/models/index.js index e0cc9a7288..60c890672c 100644 --- a/lib/services/mediaServicesManagement/lib/models/index.js +++ b/lib/services/mediaServicesManagement/lib/models/index.js @@ -18,24 +18,37 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; +exports.PresentationTimeRange = require('./presentationTimeRange'); +exports.FilterTrackPropertyCondition = require('./filterTrackPropertyCondition'); +exports.FirstQuality = require('./firstQuality'); +exports.FilterTrackSelection = require('./filterTrackSelection'); +exports.Resource = require('./resource'); +exports.ProxyResource = require('./proxyResource'); +exports.AccountFilter = require('./accountFilter'); +exports.ODataError = require('./oDataError'); +exports.ApiError = require('./apiError'); +exports.TrackedResource = require('./trackedResource'); exports.Provider = require('./provider'); exports.OperationDisplay = require('./operationDisplay'); +exports.MetricDimension = require('./metricDimension'); +exports.Metric = require('./metric'); +exports.ServiceSpecification = require('./serviceSpecification'); +exports.MetricProperties = require('./metricProperties'); exports.Operation = require('./operation'); exports.Location = require('./location'); exports.EntityNameAvailabilityCheckOutput = require('./entityNameAvailabilityCheckOutput'); exports.StorageAccount = require('./storageAccount'); exports.SyncStorageKeysInput = require('./syncStorageKeysInput'); -exports.Resource = require('./resource'); -exports.TrackedResource = require('./trackedResource'); exports.MediaService = require('./mediaService'); exports.SubscriptionMediaService = require('./subscriptionMediaService'); -exports.ODataError = require('./oDataError'); -exports.ApiError = require('./apiError'); exports.CheckNameAvailabilityInput = require('./checkNameAvailabilityInput'); -exports.ProxyResource = require('./proxyResource'); exports.AssetContainerSas = require('./assetContainerSas'); -exports.AssetStorageEncryptionKey = require('./assetStorageEncryptionKey'); +exports.AssetFileEncryptionMetadata = require('./assetFileEncryptionMetadata'); +exports.StorageEncryptedAssetDecryptionData = require('./storageEncryptedAssetDecryptionData'); +exports.AssetStreamingLocator = require('./assetStreamingLocator'); +exports.ListStreamingLocatorsResponse = require('./listStreamingLocatorsResponse'); exports.Asset = require('./asset'); +exports.AssetFilter = require('./assetFilter'); exports.ListContainerSasInput = require('./listContainerSasInput'); exports.ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction = require('./contentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction'); exports.ContentKeyPolicyPlayReadyContentKeyLocation = require('./contentKeyPolicyPlayReadyContentKeyLocation'); @@ -131,9 +144,10 @@ exports.StreamingLocator = require('./streamingLocator'); exports.Hls = require('./hls'); exports.LiveOutput = require('./liveOutput'); exports.LiveEventEndpoint = require('./liveEventEndpoint'); -exports.LiveEventInput = require('./liveEventInput'); exports.IPRange = require('./iPRange'); exports.IPAccessControl = require('./iPAccessControl'); +exports.LiveEventInputAccessControl = require('./liveEventInputAccessControl'); +exports.LiveEventInput = require('./liveEventInput'); exports.LiveEventPreviewAccessControl = require('./liveEventPreviewAccessControl'); exports.LiveEventPreview = require('./liveEventPreview'); exports.LiveEventEncoding = require('./liveEventEncoding'); @@ -145,10 +159,12 @@ exports.AkamaiAccessControl = require('./akamaiAccessControl'); exports.StreamingEndpointAccessControl = require('./streamingEndpointAccessControl'); exports.StreamingEntityScaleUnit = require('./streamingEntityScaleUnit'); exports.StreamingEndpoint = require('./streamingEndpoint'); +exports.AccountFilterCollection = require('./accountFilterCollection'); exports.OperationCollection = require('./operationCollection'); exports.MediaServiceCollection = require('./mediaServiceCollection'); exports.SubscriptionMediaServiceCollection = require('./subscriptionMediaServiceCollection'); exports.AssetCollection = require('./assetCollection'); +exports.AssetFilterCollection = require('./assetFilterCollection'); exports.ContentKeyPolicyCollection = require('./contentKeyPolicyCollection'); exports.TransformCollection = require('./transformCollection'); exports.JobCollection = require('./jobCollection'); diff --git a/lib/services/mediaServicesManagement/lib/models/job.js b/lib/services/mediaServicesManagement/lib/models/job.js index aa75cc7f8e..ac3677dc6e 100644 --- a/lib/services/mediaServicesManagement/lib/models/job.js +++ b/lib/services/mediaServicesManagement/lib/models/job.js @@ -29,12 +29,6 @@ class Job extends models['ProxyResource'] { * @member {string} [description] Optional customer supplied description of * the Job. * @member {object} input The inputs for the Job. - * @member {string} [input.label] A label that is assigned to a JobInput, - * that is used to satisfy a reference used in the Transform. For example, a - * Transform can be authored so as to take an image file with the label 'xyz' - * and apply it as an overlay onto the input video before it is encoded. When - * submitting a Job, exactly one of the JobInputs should be the image file, - * and it should have the label 'xyz'. * @member {string} [input.odatatype] Polymorphic Discriminator * @member {date} [lastModified] The UTC date and time when the Job was last * updated, in 'YYYY-MM-DDThh:mm:ssZ' format. @@ -44,7 +38,7 @@ class Job extends models['ProxyResource'] { * If not set, the default is normal. Possible values include: 'Low', * 'Normal', 'High' * @member {object} [correlationData] Customer provided correlation data that - * will be returned in Job completed events. + * will be returned in Job and JobOutput state events. */ constructor() { super(); @@ -90,6 +84,7 @@ class Job extends models['ProxyResource'] { }, created: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.created', type: { @@ -98,6 +93,7 @@ class Job extends models['ProxyResource'] { }, state: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.state', type: { @@ -127,6 +123,7 @@ class Job extends models['ProxyResource'] { }, lastModified: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModified', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/jobError.js b/lib/services/mediaServicesManagement/lib/models/jobError.js index 4b681fe48b..57c7703a42 100644 --- a/lib/services/mediaServicesManagement/lib/models/jobError.js +++ b/lib/services/mediaServicesManagement/lib/models/jobError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Details of JobOutput errors. * @@ -53,6 +51,7 @@ class JobError { modelProperties: { code: { required: false, + nullable: false, readOnly: true, serializedName: 'code', type: { @@ -70,6 +69,7 @@ class JobError { }, category: { required: false, + nullable: false, readOnly: true, serializedName: 'category', type: { @@ -79,6 +79,7 @@ class JobError { }, retry: { required: false, + nullable: false, readOnly: true, serializedName: 'retry', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/jobInput.js b/lib/services/mediaServicesManagement/lib/models/jobInput.js index bf36df2331..97d4988679 100644 --- a/lib/services/mediaServicesManagement/lib/models/jobInput.js +++ b/lib/services/mediaServicesManagement/lib/models/jobInput.js @@ -17,12 +17,6 @@ class JobInput { /** * Create a JobInput. - * @member {string} [label] A label that is assigned to a JobInput, that is - * used to satisfy a reference used in the Transform. For example, a - * Transform can be authored so as to take an image file with the label 'xyz' - * and apply it as an overlay onto the input video before it is encoded. When - * submitting a Job, exactly one of the JobInputs should be the image file, - * and it should have the label 'xyz'. * @member {string} odatatype Polymorphic Discriminator */ constructor() { @@ -47,13 +41,6 @@ class JobInput { uberParent: 'JobInput', className: 'JobInput', modelProperties: { - label: { - required: false, - serializedName: 'label', - type: { - name: 'String' - } - }, odatatype: { required: true, serializedName: '@odata\\.type', diff --git a/lib/services/mediaServicesManagement/lib/models/jobInputAsset.js b/lib/services/mediaServicesManagement/lib/models/jobInputAsset.js index 6b33b9e85c..d86b44a912 100644 --- a/lib/services/mediaServicesManagement/lib/models/jobInputAsset.js +++ b/lib/services/mediaServicesManagement/lib/models/jobInputAsset.js @@ -45,13 +45,6 @@ class JobInputAsset extends models['JobInputClip'] { uberParent: 'JobInput', className: 'JobInputAsset', modelProperties: { - label: { - required: false, - serializedName: 'label', - type: { - name: 'String' - } - }, odatatype: { required: true, serializedName: '@odata\\.type', @@ -74,6 +67,13 @@ class JobInputAsset extends models['JobInputClip'] { } } }, + label: { + required: false, + serializedName: 'label', + type: { + name: 'String' + } + }, assetName: { required: true, serializedName: 'assetName', diff --git a/lib/services/mediaServicesManagement/lib/models/jobInputClip.js b/lib/services/mediaServicesManagement/lib/models/jobInputClip.js index dfaf14e73c..d97e599b9e 100644 --- a/lib/services/mediaServicesManagement/lib/models/jobInputClip.js +++ b/lib/services/mediaServicesManagement/lib/models/jobInputClip.js @@ -21,6 +21,12 @@ class JobInputClip extends models['JobInput'] { /** * Create a JobInputClip. * @member {array} [files] List of files. Required for JobInputHttp. + * @member {string} [label] A label that is assigned to a JobInputClip, that + * is used to satisfy a reference used in the Transform. For example, a + * Transform can be authored so as to take an image file with the label 'xyz' + * and apply it as an overlay onto the input video before it is encoded. When + * submitting a Job, exactly one of the JobInputs should be the image file, + * and it should have the label 'xyz'. */ constructor() { super(); @@ -45,13 +51,6 @@ class JobInputClip extends models['JobInput'] { uberParent: 'JobInput', className: 'JobInputClip', modelProperties: { - label: { - required: false, - serializedName: 'label', - type: { - name: 'String' - } - }, odatatype: { required: true, serializedName: '@odata\\.type', @@ -73,6 +72,13 @@ class JobInputClip extends models['JobInput'] { } } } + }, + label: { + required: false, + serializedName: 'label', + type: { + name: 'String' + } } } } diff --git a/lib/services/mediaServicesManagement/lib/models/jobInputHttp.js b/lib/services/mediaServicesManagement/lib/models/jobInputHttp.js index a81c2aad69..55958106d0 100644 --- a/lib/services/mediaServicesManagement/lib/models/jobInputHttp.js +++ b/lib/services/mediaServicesManagement/lib/models/jobInputHttp.js @@ -47,13 +47,6 @@ class JobInputHttp extends models['JobInputClip'] { uberParent: 'JobInput', className: 'JobInputHttp', modelProperties: { - label: { - required: false, - serializedName: 'label', - type: { - name: 'String' - } - }, odatatype: { required: true, serializedName: '@odata\\.type', @@ -76,6 +69,13 @@ class JobInputHttp extends models['JobInputClip'] { } } }, + label: { + required: false, + serializedName: 'label', + type: { + name: 'String' + } + }, baseUri: { required: false, serializedName: 'baseUri', diff --git a/lib/services/mediaServicesManagement/lib/models/jobInputs.js b/lib/services/mediaServicesManagement/lib/models/jobInputs.js index 3e8d03f276..2ae98fa5de 100644 --- a/lib/services/mediaServicesManagement/lib/models/jobInputs.js +++ b/lib/services/mediaServicesManagement/lib/models/jobInputs.js @@ -45,13 +45,6 @@ class JobInputs extends models['JobInput'] { uberParent: 'JobInput', className: 'JobInputs', modelProperties: { - label: { - required: false, - serializedName: 'label', - type: { - name: 'String' - } - }, odatatype: { required: true, serializedName: '@odata\\.type', diff --git a/lib/services/mediaServicesManagement/lib/models/jobOutput.js b/lib/services/mediaServicesManagement/lib/models/jobOutput.js index fa8f6ea839..6b5699f157 100644 --- a/lib/services/mediaServicesManagement/lib/models/jobOutput.js +++ b/lib/services/mediaServicesManagement/lib/models/jobOutput.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes all the properties of a JobOutput. * @@ -40,9 +38,21 @@ class JobOutput { * values include: 'Canceled', 'Canceling', 'Error', 'Finished', * 'Processing', 'Queued', 'Scheduled' * @member {number} [progress] If the JobOutput is in a Processing state, - * this contains the job completion percentage. The value is an estimate and - * not intended to be used to predict job completion times. To determine if + * this contains the Job completion percentage. The value is an estimate and + * not intended to be used to predict Job completion times. To determine if * the JobOutput is complete, use the State property. + * @member {string} [label] A label that is assigned to a JobOutput in order + * to help uniquely identify it. This is useful when your Transform has more + * than one TransformOutput, whereby your Job has more than one JobOutput. In + * such cases, when you submit the Job, you will add two or more JobOutputs, + * in the same order as TransformOutputs in the Transform. Subsequently, when + * you retrieve the Job, either through events or on a GET request, you can + * use the label to easily identify the JobOutput. If a label is not + * provided, a default value of '{presetName}_{outputIndex}' will be used, + * where the preset name is the name of the preset in the corresponding + * TransformOutput and the output index is the relative index of the this + * JobOutput within the Job. Note that this index is the same as the relative + * index of the corresponding TransformOutput within its Transform. * @member {string} odatatype Polymorphic Discriminator */ constructor() { @@ -78,6 +88,7 @@ class JobOutput { }, state: { required: false, + nullable: false, readOnly: true, serializedName: 'state', type: { @@ -87,12 +98,20 @@ class JobOutput { }, progress: { required: false, + nullable: false, readOnly: true, serializedName: 'progress', type: { name: 'Number' } }, + label: { + required: false, + serializedName: 'label', + type: { + name: 'String' + } + }, odatatype: { required: true, serializedName: '@odata\\.type', diff --git a/lib/services/mediaServicesManagement/lib/models/jobOutputAsset.js b/lib/services/mediaServicesManagement/lib/models/jobOutputAsset.js index 15747d6bb4..98b2b3ee0c 100644 --- a/lib/services/mediaServicesManagement/lib/models/jobOutputAsset.js +++ b/lib/services/mediaServicesManagement/lib/models/jobOutputAsset.js @@ -56,6 +56,7 @@ class JobOutputAsset extends models['JobOutput'] { }, state: { required: false, + nullable: false, readOnly: true, serializedName: 'state', type: { @@ -65,12 +66,20 @@ class JobOutputAsset extends models['JobOutput'] { }, progress: { required: false, + nullable: false, readOnly: true, serializedName: 'progress', type: { name: 'Number' } }, + label: { + required: false, + serializedName: 'label', + type: { + name: 'String' + } + }, odatatype: { required: true, serializedName: '@odata\\.type', diff --git a/lib/services/mediaServicesManagement/lib/models/listContainerSasInput.js b/lib/services/mediaServicesManagement/lib/models/listContainerSasInput.js index 856a7ed981..b57953d33a 100644 --- a/lib/services/mediaServicesManagement/lib/models/listContainerSasInput.js +++ b/lib/services/mediaServicesManagement/lib/models/listContainerSasInput.js @@ -11,7 +11,7 @@ 'use strict'; /** - * The parameters to the list SAS requet. + * The parameters to the list SAS request. * */ class ListContainerSasInput { diff --git a/lib/services/mediaServicesManagement/lib/models/listContentKeysResponse.js b/lib/services/mediaServicesManagement/lib/models/listContentKeysResponse.js index baea4ff95e..de0d1fdb0f 100644 --- a/lib/services/mediaServicesManagement/lib/models/listContentKeysResponse.js +++ b/lib/services/mediaServicesManagement/lib/models/listContentKeysResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class of response for listContentKeys action * diff --git a/lib/services/mediaServicesManagement/lib/models/listPathsResponse.js b/lib/services/mediaServicesManagement/lib/models/listPathsResponse.js index 6810a92fc3..15c813856e 100644 --- a/lib/services/mediaServicesManagement/lib/models/listPathsResponse.js +++ b/lib/services/mediaServicesManagement/lib/models/listPathsResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class of response for listPaths action * diff --git a/lib/services/mediaServicesManagement/lib/models/listStreamingLocatorsResponse.js b/lib/services/mediaServicesManagement/lib/models/listStreamingLocatorsResponse.js new file mode 100644 index 0000000000..9533ab636c --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/listStreamingLocatorsResponse.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The Streaming Locators associated with this Asset. + * + */ +class ListStreamingLocatorsResponse { + /** + * Create a ListStreamingLocatorsResponse. + * @member {array} [streamingLocators] The list of Streaming Locators. + */ + constructor() { + } + + /** + * Defines the metadata of ListStreamingLocatorsResponse + * + * @returns {object} metadata of ListStreamingLocatorsResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ListStreamingLocatorsResponse', + type: { + name: 'Composite', + className: 'ListStreamingLocatorsResponse', + modelProperties: { + streamingLocators: { + required: false, + readOnly: true, + serializedName: 'streamingLocators', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AssetStreamingLocatorElementType', + type: { + name: 'Composite', + className: 'AssetStreamingLocator' + } + } + } + } + } + } + }; + } +} + +module.exports = ListStreamingLocatorsResponse; diff --git a/lib/services/mediaServicesManagement/lib/models/liveEvent.js b/lib/services/mediaServicesManagement/lib/models/liveEvent.js index c32101e92d..c5a0e1b180 100644 --- a/lib/services/mediaServicesManagement/lib/models/liveEvent.js +++ b/lib/services/mediaServicesManagement/lib/models/liveEvent.js @@ -23,10 +23,18 @@ class LiveEvent extends models['TrackedResource'] { * @member {string} [description] The Live Event description. * @member {object} input The Live Event input. * @member {string} [input.streamingProtocol] The streaming protocol for the - * Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * Live Event. This is specified at creation time and cannot be updated. + * Possible values include: 'FragmentedMP4', 'RTMP' + * @member {object} [input.accessControl] The access control for LiveEvent + * Input. + * @member {object} [input.accessControl.ip] The IP access control + * properties. + * @member {array} [input.accessControl.ip.allow] The IP allow list. * @member {string} [input.keyFrameIntervalDuration] ISO 8601 timespan * duration of the key frame interval duration. - * @member {string} [input.accessToken] The access token. + * @member {string} [input.accessToken] A unique identifier for a stream. + * This can be specified at creation time but cannot be updated. If omitted, + * the service will generate a unique value. * @member {array} [input.endpoints] The input endpoints for the Live Event. * @member {object} [preview] The Live Event preview. * @member {array} [preview.endpoints] The endpoints for preview. @@ -35,19 +43,26 @@ class LiveEvent extends models['TrackedResource'] { * @member {object} [preview.accessControl.ip] The IP access control * properties. * @member {array} [preview.accessControl.ip.allow] The IP allow list. - * @member {string} [preview.previewLocator] The preview locator Guid. + * @member {string} [preview.previewLocator] The identifier of the preview + * locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * @member {string} [preview.streamingPolicyName] The name of streaming - * policy used for LiveEvent preview + * policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * @member {string} [preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used - * to distinguish the preview of different live events for authorization - * purposes in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * @member {object} [encoding] The Live Event encoding. * @member {string} [encoding.encodingType] The encoding type for Live Event. - * Possible values include: 'None', 'Basic' - * @member {string} [encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. Possible + * values include: 'None', 'Basic' + * @member {string} [encoding.presetName] The encoding preset name. This + * value is specified at creation time and cannot be updated. * @member {string} [provisioningState] The provisioning state of the Live * Event. * @member {string} [resourceState] The resource state of the Live Event. @@ -58,8 +73,11 @@ class LiveEvent extends models['TrackedResource'] { * of clientaccesspolicy.xml used by Silverlight. * @member {string} [crossSiteAccessPolicies.crossDomainPolicy] The content * of crossdomain.xml used by Silverlight. - * @member {boolean} [vanityUrl] The Live Event vanity URL flag. - * @member {array} [streamOptions] The stream options. + * @member {boolean} [vanityUrl] Specifies whether to use a vanity url with + * the Live Event. This value is specified at creation time and cannot be + * updated. + * @member {array} [streamOptions] The options to use for the LiveEvent. + * This value is specified at creation time and cannot be updated. * @member {date} [created] The exact time the Live Event was created. * @member {date} [lastModified] The exact time the Live Event was last * modified. diff --git a/lib/services/mediaServicesManagement/lib/models/liveEventEncoding.js b/lib/services/mediaServicesManagement/lib/models/liveEventEncoding.js index a14a71279a..56714adbf0 100644 --- a/lib/services/mediaServicesManagement/lib/models/liveEventEncoding.js +++ b/lib/services/mediaServicesManagement/lib/models/liveEventEncoding.js @@ -17,9 +17,11 @@ class LiveEventEncoding { /** * Create a LiveEventEncoding. - * @member {string} [encodingType] The encoding type for Live Event. Possible - * values include: 'None', 'Basic' - * @member {string} [presetName] The encoding preset name. + * @member {string} [encodingType] The encoding type for Live Event. This + * value is specified at creation time and cannot be updated. Possible values + * include: 'None', 'Basic' + * @member {string} [presetName] The encoding preset name. This value is + * specified at creation time and cannot be updated. */ constructor() { } diff --git a/lib/services/mediaServicesManagement/lib/models/liveEventInput.js b/lib/services/mediaServicesManagement/lib/models/liveEventInput.js index cef67e5b23..94c2bb4209 100644 --- a/lib/services/mediaServicesManagement/lib/models/liveEventInput.js +++ b/lib/services/mediaServicesManagement/lib/models/liveEventInput.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The Live Event input. * @@ -20,10 +18,16 @@ class LiveEventInput { /** * Create a LiveEventInput. * @member {string} streamingProtocol The streaming protocol for the Live - * Event. Possible values include: 'FragmentedMP4', 'RTMP' + * Event. This is specified at creation time and cannot be updated. Possible + * values include: 'FragmentedMP4', 'RTMP' + * @member {object} [accessControl] The access control for LiveEvent Input. + * @member {object} [accessControl.ip] The IP access control properties. + * @member {array} [accessControl.ip.allow] The IP allow list. * @member {string} [keyFrameIntervalDuration] ISO 8601 timespan duration of * the key frame interval duration. - * @member {string} [accessToken] The access token. + * @member {string} [accessToken] A unique identifier for a stream. This can + * be specified at creation time but cannot be updated. If omitted, the + * service will generate a unique value. * @member {array} [endpoints] The input endpoints for the Live Event. */ constructor() { @@ -51,6 +55,14 @@ class LiveEventInput { allowedValues: [ 'FragmentedMP4', 'RTMP' ] } }, + accessControl: { + required: false, + serializedName: 'accessControl', + type: { + name: 'Composite', + className: 'LiveEventInputAccessControl' + } + }, keyFrameIntervalDuration: { required: false, serializedName: 'keyFrameIntervalDuration', diff --git a/lib/services/mediaServicesManagement/lib/models/liveEventInputAccessControl.js b/lib/services/mediaServicesManagement/lib/models/liveEventInputAccessControl.js new file mode 100644 index 0000000000..a3d4514244 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/liveEventInputAccessControl.js @@ -0,0 +1,54 @@ +/* + * 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 IP access control for Live Event Input. + * + */ +class LiveEventInputAccessControl { + /** + * Create a LiveEventInputAccessControl. + * @member {object} [ip] The IP access control properties. + * @member {array} [ip.allow] The IP allow list. + */ + constructor() { + } + + /** + * Defines the metadata of LiveEventInputAccessControl + * + * @returns {object} metadata of LiveEventInputAccessControl + * + */ + mapper() { + return { + required: false, + serializedName: 'LiveEventInputAccessControl', + type: { + name: 'Composite', + className: 'LiveEventInputAccessControl', + modelProperties: { + ip: { + required: false, + serializedName: 'ip', + type: { + name: 'Composite', + className: 'IPAccessControl' + } + } + } + } + }; + } +} + +module.exports = LiveEventInputAccessControl; diff --git a/lib/services/mediaServicesManagement/lib/models/liveEventPreview.js b/lib/services/mediaServicesManagement/lib/models/liveEventPreview.js index c1fb7acf45..f58b58966e 100644 --- a/lib/services/mediaServicesManagement/lib/models/liveEventPreview.js +++ b/lib/services/mediaServicesManagement/lib/models/liveEventPreview.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The Live Event preview. * @@ -23,13 +21,18 @@ class LiveEventPreview { * @member {object} [accessControl] The access control for LiveEvent preview. * @member {object} [accessControl.ip] The IP access control properties. * @member {array} [accessControl.ip.allow] The IP allow list. - * @member {string} [previewLocator] The preview locator Guid. + * @member {string} [previewLocator] The identifier of the preview locator in + * Guid format. Specifying this at creation time allows the caller to know + * the preview locator url before the event is created. If omitted, the + * service will generate a random identifier. This value cannot be updated + * once the live event is created. * @member {string} [streamingPolicyName] The name of streaming policy used - * for LiveEvent preview + * for the LiveEvent preview. This value is specified at creation time and + * cannot be updated. * @member {string} [alternativeMediaId] An Alternative Media Identifier - * associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization - * purposes in the CustomLicenseAcquisitionUrlTemplate or the + * associated with the StreamingLocator created for the preview. This value + * is specified at creation time and cannot be updated. The identifier can + * be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. */ diff --git a/lib/services/mediaServicesManagement/lib/models/liveEventPreviewAccessControl.js b/lib/services/mediaServicesManagement/lib/models/liveEventPreviewAccessControl.js index c24461ca27..8a8ff759da 100644 --- a/lib/services/mediaServicesManagement/lib/models/liveEventPreviewAccessControl.js +++ b/lib/services/mediaServicesManagement/lib/models/liveEventPreviewAccessControl.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The IP access control for Live Event preview. * diff --git a/lib/services/mediaServicesManagement/lib/models/liveOutput.js b/lib/services/mediaServicesManagement/lib/models/liveOutput.js index 0c1451f50c..f030de889a 100644 --- a/lib/services/mediaServicesManagement/lib/models/liveOutput.js +++ b/lib/services/mediaServicesManagement/lib/models/liveOutput.js @@ -25,7 +25,8 @@ class LiveOutput extends models['ProxyResource'] { * @member {moment.duration} archiveWindowLength ISO 8601 timespan duration * of the archive window length. This is duration that customer want to * retain the recorded content. - * @member {string} [manifestName] The manifest file name. + * @member {string} [manifestName] The manifest file name. If not provided, + * the service will generate one automatically. * @member {object} [hls] The HLS configuration. * @member {number} [hls.fragmentsPerTsSegment] The amount of fragments per * HTTP Live Streaming (HLS) segment. diff --git a/lib/services/mediaServicesManagement/lib/models/mediaService.js b/lib/services/mediaServicesManagement/lib/models/mediaService.js index 78680b818a..c8988d3532 100644 --- a/lib/services/mediaServicesManagement/lib/models/mediaService.js +++ b/lib/services/mediaServicesManagement/lib/models/mediaService.js @@ -88,6 +88,7 @@ class MediaService extends models['TrackedResource'] { }, mediaServiceId: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.mediaServiceId', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/metric.js b/lib/services/mediaServicesManagement/lib/models/metric.js new file mode 100644 index 0000000000..386eca2813 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/metric.js @@ -0,0 +1,112 @@ +/* + * 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'; + +/** + * A metric emitted by service. + * + */ +class Metric { + /** + * Create a Metric. + * @member {string} [name] The metric name. + * @member {string} [displayName] The metric display name. + * @member {string} [displayDescription] The metric display description. + * @member {string} [unit] The metric unit. Possible values include: 'Bytes', + * 'Count', 'Milliseconds' + * @member {string} [aggregationType] The metric aggregation type. Possible + * values include: 'Average', 'Count', 'Total' + * @member {array} [dimensions] The metric dimensions. + */ + constructor() { + } + + /** + * Defines the metadata of Metric + * + * @returns {object} metadata of Metric + * + */ + mapper() { + return { + required: false, + serializedName: 'Metric', + type: { + name: 'Composite', + className: 'Metric', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + readOnly: true, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + displayDescription: { + required: false, + readOnly: true, + serializedName: 'displayDescription', + type: { + name: 'String' + } + }, + unit: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'Enum', + allowedValues: [ 'Bytes', 'Count', 'Milliseconds' ] + } + }, + aggregationType: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'aggregationType', + type: { + name: 'Enum', + allowedValues: [ 'Average', 'Count', 'Total' ] + } + }, + dimensions: { + required: false, + readOnly: true, + serializedName: 'dimensions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MetricDimensionElementType', + type: { + name: 'Composite', + className: 'MetricDimension' + } + } + } + } + } + } + }; + } +} + +module.exports = Metric; diff --git a/lib/services/mediaServicesManagement/lib/models/metricDimension.js b/lib/services/mediaServicesManagement/lib/models/metricDimension.js new file mode 100644 index 0000000000..1071cd15d3 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/metricDimension.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * A metric dimension. + * + */ +class MetricDimension { + /** + * Create a MetricDimension. + * @member {string} [name] The metric dimension name. + * @member {string} [displayName] The display name for the dimension. + * @member {boolean} [toBeExportedForShoebox] Whether to export metric to + * shoebox. + */ + constructor() { + } + + /** + * Defines the metadata of MetricDimension + * + * @returns {object} metadata of MetricDimension + * + */ + mapper() { + return { + required: false, + serializedName: 'MetricDimension', + type: { + name: 'Composite', + className: 'MetricDimension', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + readOnly: true, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + toBeExportedForShoebox: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'toBeExportedForShoebox', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MetricDimension; diff --git a/lib/services/mediaServicesManagement/lib/models/metricProperties.js b/lib/services/mediaServicesManagement/lib/models/metricProperties.js new file mode 100644 index 0000000000..27dc241252 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/metricProperties.js @@ -0,0 +1,56 @@ +/* + * 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'; + +/** + * Metric properties. + * + */ +class MetricProperties { + /** + * Create a MetricProperties. + * @member {object} [serviceSpecification] The service specifications. + * @member {array} [serviceSpecification.metricSpecifications] List of metric + * specifications. + */ + constructor() { + } + + /** + * Defines the metadata of MetricProperties + * + * @returns {object} metadata of MetricProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'MetricProperties', + type: { + name: 'Composite', + className: 'MetricProperties', + modelProperties: { + serviceSpecification: { + required: false, + readOnly: true, + serializedName: 'serviceSpecification', + type: { + name: 'Composite', + className: 'ServiceSpecification' + } + } + } + } + }; + } +} + +module.exports = MetricProperties; diff --git a/lib/services/mediaServicesManagement/lib/models/noEncryption.js b/lib/services/mediaServicesManagement/lib/models/noEncryption.js index 4869916258..caccbec6d1 100644 --- a/lib/services/mediaServicesManagement/lib/models/noEncryption.js +++ b/lib/services/mediaServicesManagement/lib/models/noEncryption.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class for NoEncryption scheme * diff --git a/lib/services/mediaServicesManagement/lib/models/oDataError.js b/lib/services/mediaServicesManagement/lib/models/oDataError.js index 71709aaa37..0eff90e910 100644 --- a/lib/services/mediaServicesManagement/lib/models/oDataError.js +++ b/lib/services/mediaServicesManagement/lib/models/oDataError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about an error. * diff --git a/lib/services/mediaServicesManagement/lib/models/operation.js b/lib/services/mediaServicesManagement/lib/models/operation.js index bcdd1b618e..b407d331ee 100644 --- a/lib/services/mediaServicesManagement/lib/models/operation.js +++ b/lib/services/mediaServicesManagement/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An operation. * @@ -26,6 +24,12 @@ class Operation { * performed. * @member {string} [display.operation] The operation type. * @member {string} [display.description] The operation description. + * @member {string} [origin] Origin of the operation. + * @member {object} [properties] Operation properties format. + * @member {object} [properties.serviceSpecification] The service + * specifications. + * @member {array} [properties.serviceSpecification.metricSpecifications] + * List of metric specifications. */ constructor() { } @@ -58,6 +62,21 @@ class Operation { name: 'Composite', className: 'OperationDisplay' } + }, + origin: { + required: false, + serializedName: 'origin', + type: { + name: 'String' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'MetricProperties' + } } } } diff --git a/lib/services/mediaServicesManagement/lib/models/presentationTimeRange.js b/lib/services/mediaServicesManagement/lib/models/presentationTimeRange.js new file mode 100644 index 0000000000..cd1039bf4f --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/presentationTimeRange.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'; + +/** + * The presentation time range, this is asset related and not recommended for + * Account Filter. + * + */ +class PresentationTimeRange { + /** + * Create a PresentationTimeRange. + * @member {number} startTimestamp The absolute start time boundary. + * @member {number} endTimestamp The absolute end time boundary. + * @member {number} presentationWindowDuration The relative to end sliding + * window. + * @member {number} liveBackoffDuration The relative to end right edge. + * @member {number} timescale The time scale of time stamps. + * @member {boolean} forceEndTimestamp The indicator of forcing exsiting of + * end time stamp. + */ + constructor() { + } + + /** + * Defines the metadata of PresentationTimeRange + * + * @returns {object} metadata of PresentationTimeRange + * + */ + mapper() { + return { + required: false, + serializedName: 'PresentationTimeRange', + type: { + name: 'Composite', + className: 'PresentationTimeRange', + modelProperties: { + startTimestamp: { + required: true, + serializedName: 'startTimestamp', + type: { + name: 'Number' + } + }, + endTimestamp: { + required: true, + serializedName: 'endTimestamp', + type: { + name: 'Number' + } + }, + presentationWindowDuration: { + required: true, + serializedName: 'presentationWindowDuration', + type: { + name: 'Number' + } + }, + liveBackoffDuration: { + required: true, + serializedName: 'liveBackoffDuration', + type: { + name: 'Number' + } + }, + timescale: { + required: true, + serializedName: 'timescale', + type: { + name: 'Number' + } + }, + forceEndTimestamp: { + required: true, + serializedName: 'forceEndTimestamp', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = PresentationTimeRange; diff --git a/lib/services/mediaServicesManagement/lib/models/serviceSpecification.js b/lib/services/mediaServicesManagement/lib/models/serviceSpecification.js new file mode 100644 index 0000000000..1c23d8c6b3 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/serviceSpecification.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The service metric specifications. + * + */ +class ServiceSpecification { + /** + * Create a ServiceSpecification. + * @member {array} [metricSpecifications] List of metric specifications. + */ + 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, + readOnly: true, + serializedName: 'metricSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MetricElementType', + type: { + name: 'Composite', + className: 'Metric' + } + } + } + } + } + } + }; + } +} + +module.exports = ServiceSpecification; diff --git a/lib/services/mediaServicesManagement/lib/models/storageEncryptedAssetDecryptionData.js b/lib/services/mediaServicesManagement/lib/models/storageEncryptedAssetDecryptionData.js new file mode 100644 index 0000000000..83ef8bfe00 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/models/storageEncryptedAssetDecryptionData.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'; + +/** + * Data needed to decrypt asset files encrypted with legacy storage encryption. + * + */ +class StorageEncryptedAssetDecryptionData { + /** + * Create a StorageEncryptedAssetDecryptionData. + * @member {buffer} [key] The Asset File storage encryption key. + * @member {array} [assetFileEncryptionMetadata] Asset File encryption + * metadata. + */ + constructor() { + } + + /** + * Defines the metadata of StorageEncryptedAssetDecryptionData + * + * @returns {object} metadata of StorageEncryptedAssetDecryptionData + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageEncryptedAssetDecryptionData', + type: { + name: 'Composite', + className: 'StorageEncryptedAssetDecryptionData', + modelProperties: { + key: { + required: false, + serializedName: 'key', + type: { + name: 'ByteArray' + } + }, + assetFileEncryptionMetadata: { + required: false, + serializedName: 'assetFileEncryptionMetadata', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AssetFileEncryptionMetadataElementType', + type: { + name: 'Composite', + className: 'AssetFileEncryptionMetadata' + } + } + } + } + } + } + }; + } +} + +module.exports = StorageEncryptedAssetDecryptionData; diff --git a/lib/services/mediaServicesManagement/lib/models/streamingEndpoint.js b/lib/services/mediaServicesManagement/lib/models/streamingEndpoint.js index 69ada47e96..1ae859ff2a 100644 --- a/lib/services/mediaServicesManagement/lib/models/streamingEndpoint.js +++ b/lib/services/mediaServicesManagement/lib/models/streamingEndpoint.js @@ -21,8 +21,11 @@ class StreamingEndpoint extends models['TrackedResource'] { /** * Create a StreamingEndpoint. * @member {string} [description] The StreamingEndpoint description. - * @member {number} [scaleUnits] The number of scale units. - * @member {string} [availabilitySetName] AvailabilitySet name + * @member {number} scaleUnits The number of scale units. Use the Scale + * operation to adjust this value. + * @member {string} [availabilitySetName] The name of the AvailabilitySet + * used with this StreamingEndpoint for high availability streaming. This + * value can only be set at creation time. * @member {object} [accessControl] The access control definition of the * StreamingEndpoint. * @member {object} [accessControl.akamai] The access control of Akamai @@ -126,7 +129,7 @@ class StreamingEndpoint extends models['TrackedResource'] { } }, scaleUnits: { - required: false, + required: true, serializedName: 'properties.scaleUnits', type: { name: 'Number' diff --git a/lib/services/mediaServicesManagement/lib/models/streamingEndpointAccessControl.js b/lib/services/mediaServicesManagement/lib/models/streamingEndpointAccessControl.js index 666cce39ec..a9bbe59b50 100644 --- a/lib/services/mediaServicesManagement/lib/models/streamingEndpointAccessControl.js +++ b/lib/services/mediaServicesManagement/lib/models/streamingEndpointAccessControl.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * StreamingEndpoint access control definition. * diff --git a/lib/services/mediaServicesManagement/lib/models/streamingEntityScaleUnit.js b/lib/services/mediaServicesManagement/lib/models/streamingEntityScaleUnit.js index b3bc8be5cd..55ae36f932 100644 --- a/lib/services/mediaServicesManagement/lib/models/streamingEntityScaleUnit.js +++ b/lib/services/mediaServicesManagement/lib/models/streamingEntityScaleUnit.js @@ -17,7 +17,7 @@ class StreamingEntityScaleUnit { /** * Create a StreamingEntityScaleUnit. - * @member {number} [scaleUnit] ScaleUnit. The scale unit number of the + * @member {number} [scaleUnit] The scale unit number of the * StreamingEndpoint. */ constructor() { diff --git a/lib/services/mediaServicesManagement/lib/models/streamingLocator.js b/lib/services/mediaServicesManagement/lib/models/streamingLocator.js index fb991b15b8..d569d320f0 100644 --- a/lib/services/mediaServicesManagement/lib/models/streamingLocator.js +++ b/lib/services/mediaServicesManagement/lib/models/streamingLocator.js @@ -21,27 +21,24 @@ class StreamingLocator extends models['ProxyResource'] { /** * Create a StreamingLocator. * @member {string} assetName Asset Name - * @member {date} [created] Creation time of Streaming Locator - * @member {date} [startTime] StartTime of Streaming Locator - * @member {date} [endTime] EndTime of Streaming Locator - * @member {uuid} [streamingLocatorId] StreamingLocatorId of Streaming - * Locator - * @member {string} streamingPolicyName Streaming policy name used by this - * streaming locator. Either specify the name of streaming policy you created - * or use one of the predefined streaming polices. The predefined streaming - * policies available are: 'Predefined_DownloadOnly', + * @member {date} [created] The creation time of the Streaming Locator. + * @member {date} [startTime] The start time of the Streaming Locator. + * @member {date} [endTime] The end time of the Streaming Locator. + * @member {uuid} [streamingLocatorId] The StreamingLocatorId of the + * Streaming Locator. + * @member {string} streamingPolicyName Name of the Streaming Policy used by + * this Streaming Locator. Either specify the name of Streaming Policy you + * created or use one of the predefined Streaming Policies. The predefined + * Streaming Policies available are: 'Predefined_DownloadOnly', * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', - * 'Predefined_ClearKey', 'Predefined_SecureStreaming' and - * 'Predefined_SecureStreamingWithFairPlay' - * @member {string} [defaultContentKeyPolicyName] Default ContentKeyPolicy - * used by this Streaming Locator - * @member {array} [contentKeys] ContentKeys used by this Streaming Locator - * @member {string} [alternativeMediaId] An Alternative Media Identifier - * associated with the StreamingLocator. This identifier can be used to - * distinguish different StreamingLocators for the same Asset for - * authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the - * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the - * StreamingPolicyName field. + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming' + * @member {string} [defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. + * @member {array} [contentKeys] The ContentKeys used by this Streaming + * Locator. + * @member {string} [alternativeMediaId] Alternative Media ID of this + * Streaming Locator */ constructor() { super(); @@ -94,6 +91,7 @@ class StreamingLocator extends models['ProxyResource'] { }, created: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.created', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/streamingLocatorContentKey.js b/lib/services/mediaServicesManagement/lib/models/streamingLocatorContentKey.js index a3989c5b5b..7efbc44059 100644 --- a/lib/services/mediaServicesManagement/lib/models/streamingLocatorContentKey.js +++ b/lib/services/mediaServicesManagement/lib/models/streamingLocatorContentKey.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class for content key in Streaming Locator * @@ -23,7 +21,8 @@ class StreamingLocatorContentKey { * @member {string} [type] Encryption type of Content Key. Possible values * include: 'CommonEncryptionCenc', 'CommonEncryptionCbcs', * 'EnvelopeEncryption' - * @member {string} [label] Label of Content Key + * @member {string} [labelReferenceInStreamingPolicy] Label of Content Key as + * specified in the Streaming Policy * @member {string} [value] Value of of Content Key * @member {string} [policyName] ContentKeyPolicy used by Content Key * @member {array} [tracks] Tracks which use this Content Key @@ -54,6 +53,7 @@ class StreamingLocatorContentKey { }, type: { required: false, + nullable: false, readOnly: true, serializedName: 'type', type: { @@ -61,9 +61,9 @@ class StreamingLocatorContentKey { allowedValues: [ 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption' ] } }, - label: { + labelReferenceInStreamingPolicy: { required: false, - serializedName: 'label', + serializedName: 'labelReferenceInStreamingPolicy', type: { name: 'String' } @@ -85,6 +85,7 @@ class StreamingLocatorContentKey { }, tracks: { required: false, + readOnly: true, serializedName: 'tracks', type: { name: 'Sequence', diff --git a/lib/services/mediaServicesManagement/lib/models/streamingPolicy.js b/lib/services/mediaServicesManagement/lib/models/streamingPolicy.js index a5b7e832fe..61e49465a7 100644 --- a/lib/services/mediaServicesManagement/lib/models/streamingPolicy.js +++ b/lib/services/mediaServicesManagement/lib/models/streamingPolicy.js @@ -199,6 +199,7 @@ class StreamingPolicy extends models['ProxyResource'] { }, created: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.created', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/streamingPolicyContentKey.js b/lib/services/mediaServicesManagement/lib/models/streamingPolicyContentKey.js index 79c327be8e..d8b421f105 100644 --- a/lib/services/mediaServicesManagement/lib/models/streamingPolicyContentKey.js +++ b/lib/services/mediaServicesManagement/lib/models/streamingPolicyContentKey.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class to specify properties of content key * diff --git a/lib/services/mediaServicesManagement/lib/models/streamingPolicyContentKeys.js b/lib/services/mediaServicesManagement/lib/models/streamingPolicyContentKeys.js index 707c0305e3..abe6613eeb 100644 --- a/lib/services/mediaServicesManagement/lib/models/streamingPolicyContentKeys.js +++ b/lib/services/mediaServicesManagement/lib/models/streamingPolicyContentKeys.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class to specify properties of all content keys in Streaming Policy * diff --git a/lib/services/mediaServicesManagement/lib/models/subscriptionMediaService.js b/lib/services/mediaServicesManagement/lib/models/subscriptionMediaService.js index 7db2ea8057..f2da82226f 100644 --- a/lib/services/mediaServicesManagement/lib/models/subscriptionMediaService.js +++ b/lib/services/mediaServicesManagement/lib/models/subscriptionMediaService.js @@ -88,6 +88,7 @@ class SubscriptionMediaService extends models['TrackedResource'] { }, mediaServiceId: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.mediaServiceId', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/trackSelection.js b/lib/services/mediaServicesManagement/lib/models/trackSelection.js index ac17f3eb87..4b2642651f 100644 --- a/lib/services/mediaServicesManagement/lib/models/trackSelection.js +++ b/lib/services/mediaServicesManagement/lib/models/trackSelection.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class to select a track * diff --git a/lib/services/mediaServicesManagement/lib/models/transform.js b/lib/services/mediaServicesManagement/lib/models/transform.js index a14fd9a63e..2f88fc5ea6 100644 --- a/lib/services/mediaServicesManagement/lib/models/transform.js +++ b/lib/services/mediaServicesManagement/lib/models/transform.js @@ -76,6 +76,7 @@ class Transform extends models['ProxyResource'] { }, created: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.created', type: { @@ -91,6 +92,7 @@ class Transform extends models['ProxyResource'] { }, lastModified: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModified', type: { diff --git a/lib/services/mediaServicesManagement/lib/models/transformOutput.js b/lib/services/mediaServicesManagement/lib/models/transformOutput.js index 418beb1f12..98293e6395 100644 --- a/lib/services/mediaServicesManagement/lib/models/transformOutput.js +++ b/lib/services/mediaServicesManagement/lib/models/transformOutput.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes the properties of a TransformOutput, which are the rules to be * applied while generating the desired output. @@ -23,8 +21,9 @@ class TransformOutput { * @member {string} [onError] A Transform can define more than one outputs. * This property defines what the service should do when one output fails - * either continue to produce other outputs, or, stop the other outputs. The - * default is stop. Possible values include: 'StopProcessingJob', - * 'ContinueJob' + * overall Job state will not reflect failures of outputs that are specified + * with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values + * include: 'StopProcessingJob', 'ContinueJob' * @member {string} [relativePriority] Sets the relative priority of the * TransformOutputs within a Transform. This sets the priority that the * service uses for processing TransformOutputs. The default priority is diff --git a/lib/services/mediaServicesManagement/lib/models/videoAnalyzerPreset.js b/lib/services/mediaServicesManagement/lib/models/videoAnalyzerPreset.js index b2116cce2c..1b23021e94 100644 --- a/lib/services/mediaServicesManagement/lib/models/videoAnalyzerPreset.js +++ b/lib/services/mediaServicesManagement/lib/models/videoAnalyzerPreset.js @@ -21,8 +21,11 @@ const models = require('./index'); class VideoAnalyzerPreset extends models['AudioAnalyzerPreset'] { /** * Create a VideoAnalyzerPreset. - * @member {boolean} [audioInsightsOnly] Whether to only extract audio - * insights when processing a video file. + * @member {string} [insightsToExtract] The type of insights to be extracted. + * If not set then based on the content the type will selected. If the + * content is audi only then only audio insights are extraced and if it is + * video only. Possible values include: 'AudioInsightsOnly', + * 'VideoInsightsOnly', 'AllInsights' */ constructor() { super(); @@ -62,11 +65,12 @@ class VideoAnalyzerPreset extends models['AudioAnalyzerPreset'] { name: 'String' } }, - audioInsightsOnly: { + insightsToExtract: { required: false, - serializedName: 'audioInsightsOnly', + serializedName: 'insightsToExtract', type: { - name: 'Boolean' + name: 'Enum', + allowedValues: [ 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights' ] } } } diff --git a/lib/services/mediaServicesManagement/lib/operations/accountFilters.js b/lib/services/mediaServicesManagement/lib/operations/accountFilters.js new file mode 100644 index 0000000000..7a27fd98a8 --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/operations/accountFilters.js @@ -0,0 +1,1708 @@ +/* + * 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 Account Filters + * + * List Account Filters in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account 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 AccountFilterCollection} for more + * information. + * + * {object} [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(resourceGroupName, accountName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + let queryParameters = []; + queryParameters.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['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccountFilterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 Account Filter. + * + * Get the details of an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter 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 AccountFilter} for more information. + * + * {object} [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, accountName, filterName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (filterName === null || filterName === undefined || typeof filterName.valueOf() !== 'string') { + throw new Error('filterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{filterName}', encodeURIComponent(filterName)); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccountFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 Account Filter + * + * Creates or updates an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilter} for more information. + * + * {object} [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, accountName, filterName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (filterName === null || filterName === undefined || typeof filterName.valueOf() !== 'string') { + throw new Error('filterName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{filterName}', encodeURIComponent(filterName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AccountFilter']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccountFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['AccountFilter']().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 Account Filter. + * + * Deletes an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter 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 _deleteMethod(resourceGroupName, accountName, filterName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (filterName === null || filterName === undefined || typeof filterName.valueOf() !== 'string') { + throw new Error('filterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{filterName}', encodeURIComponent(filterName)); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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 Update an Account Filter + * + * Updates an existing Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilter} for more information. + * + * {object} [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, accountName, filterName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (filterName === null || filterName === undefined || typeof filterName.valueOf() !== 'string') { + throw new Error('filterName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{filterName}', encodeURIComponent(filterName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AccountFilter']().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['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccountFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 Account Filters + * + * List Account Filters in the Media Services account. + * + * @param {string} nextPageLink The NextLink from the previous 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 AccountFilterCollection} for more + * information. + * + * {object} [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['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccountFilterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 AccountFilters. */ +class AccountFilters { + /** + * Create a AccountFilters. + * @param {AzureMediaServices} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listNext = _listNext; + } + + /** + * @summary List Account Filters + * + * List Account Filters in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account 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. + */ + listWithHttpOperationResponse(resourceGroupName, accountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, accountName, 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 Account Filters + * + * List Account Filters in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account 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 {AccountFilterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilterCollection} for more + * information. + * + * {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(resourceGroupName, accountName, options, optionalCallback) { + 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(resourceGroupName, accountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, accountName, options, optionalCallback); + } + } + + /** + * @summary Get an Account Filter. + * + * Get the details of an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter 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. + */ + getWithHttpOperationResponse(resourceGroupName, accountName, filterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, accountName, filterName, 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 Account Filter. + * + * Get the details of an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter 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 {AccountFilter} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilter} for more information. + * + * {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, accountName, filterName, options, optionalCallback) { + 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, accountName, filterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, accountName, filterName, options, optionalCallback); + } + } + + /** + * @summary Create or update an Account Filter + * + * Creates or updates an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, accountName, filterName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, filterName, 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 Create or update an Account Filter + * + * Creates or updates an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AccountFilter} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilter} for more information. + * + * {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, accountName, filterName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, filterName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, accountName, filterName, parameters, options, optionalCallback); + } + } + + /** + * @summary Delete an Account Filter. + * + * Deletes an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, accountName, filterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, accountName, filterName, 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 Account Filter. + * + * Deletes an Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter 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. + */ + deleteMethod(resourceGroupName, accountName, filterName, options, optionalCallback) { + 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, accountName, filterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, accountName, filterName, options, optionalCallback); + } + } + + /** + * @summary Update an Account Filter + * + * Updates an existing Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, accountName, filterName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, filterName, 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 Update an Account Filter + * + * Updates an existing Account Filter in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AccountFilter} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilter} for more information. + * + * {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, accountName, filterName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, filterName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, accountName, filterName, parameters, options, optionalCallback); + } + } + + /** + * @summary List Account Filters + * + * List Account Filters in the Media Services account. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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 Account Filters + * + * List Account Filters in the Media Services account. + * + * @param {string} nextPageLink The NextLink from the previous 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 {AccountFilterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilterCollection} for more + * information. + * + * {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 = AccountFilters; diff --git a/lib/services/mediaServicesManagement/lib/operations/assetFilters.js b/lib/services/mediaServicesManagement/lib/operations/assetFilters.js new file mode 100644 index 0000000000..bda8f91c9d --- /dev/null +++ b/lib/services/mediaServicesManagement/lib/operations/assetFilters.js @@ -0,0 +1,1754 @@ +/* + * 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 Asset Filters + * + * List Asset Filters associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset 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 AssetFilterCollection} for more information. + * + * {object} [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(resourceGroupName, accountName, assetName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (assetName === null || assetName === undefined || typeof assetName.valueOf() !== 'string') { + throw new Error('assetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{assetName}', encodeURIComponent(assetName)); + let queryParameters = []; + queryParameters.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['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AssetFilterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 Asset Filter. + * + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter 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 AssetFilter} for more information. + * + * {object} [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, accountName, assetName, filterName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (assetName === null || assetName === undefined || typeof assetName.valueOf() !== 'string') { + throw new Error('assetName cannot be null or undefined and it must be of type string.'); + } + if (filterName === null || filterName === undefined || typeof filterName.valueOf() !== 'string') { + throw new Error('filterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{assetName}', encodeURIComponent(assetName)); + requestUrl = requestUrl.replace('{filterName}', encodeURIComponent(filterName)); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AssetFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 Asset Filter + * + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilter} for more information. + * + * {object} [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, accountName, assetName, filterName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (assetName === null || assetName === undefined || typeof assetName.valueOf() !== 'string') { + throw new Error('assetName cannot be null or undefined and it must be of type string.'); + } + if (filterName === null || filterName === undefined || typeof filterName.valueOf() !== 'string') { + throw new Error('filterName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{assetName}', encodeURIComponent(assetName)); + requestUrl = requestUrl.replace('{filterName}', encodeURIComponent(filterName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AssetFilter']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AssetFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['AssetFilter']().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 Asset Filter. + * + * Deletes an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter 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 _deleteMethod(resourceGroupName, accountName, assetName, filterName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (assetName === null || assetName === undefined || typeof assetName.valueOf() !== 'string') { + throw new Error('assetName cannot be null or undefined and it must be of type string.'); + } + if (filterName === null || filterName === undefined || typeof filterName.valueOf() !== 'string') { + throw new Error('filterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{assetName}', encodeURIComponent(assetName)); + requestUrl = requestUrl.replace('{filterName}', encodeURIComponent(filterName)); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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 Update an Asset Filter + * + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilter} for more information. + * + * {object} [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, accountName, assetName, filterName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (assetName === null || assetName === undefined || typeof assetName.valueOf() !== 'string') { + throw new Error('assetName cannot be null or undefined and it must be of type string.'); + } + if (filterName === null || filterName === undefined || typeof filterName.valueOf() !== 'string') { + throw new Error('filterName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{assetName}', encodeURIComponent(assetName)); + requestUrl = requestUrl.replace('{filterName}', encodeURIComponent(filterName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AssetFilter']().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['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AssetFilter']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 Asset Filters + * + * List Asset Filters associated with the specified Asset. + * + * @param {string} nextPageLink The NextLink from the previous 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 AssetFilterCollection} for more information. + * + * {object} [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['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AssetFilterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 AssetFilters. */ +class AssetFilters { + /** + * Create a AssetFilters. + * @param {AzureMediaServices} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listNext = _listNext; + } + + /** + * @summary List Asset Filters + * + * List Asset Filters associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset 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. + */ + listWithHttpOperationResponse(resourceGroupName, accountName, assetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, accountName, assetName, 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 Asset Filters + * + * List Asset Filters associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset 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 {AssetFilterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilterCollection} for more information. + * + * {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(resourceGroupName, accountName, assetName, options, optionalCallback) { + 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(resourceGroupName, accountName, assetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, accountName, assetName, options, optionalCallback); + } + } + + /** + * @summary Get an Asset Filter. + * + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter 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. + */ + getWithHttpOperationResponse(resourceGroupName, accountName, assetName, filterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, accountName, assetName, filterName, 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 Asset Filter. + * + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter 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 {AssetFilter} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilter} for more information. + * + * {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, accountName, assetName, filterName, options, optionalCallback) { + 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, accountName, assetName, filterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, accountName, assetName, filterName, options, optionalCallback); + } + } + + /** + * @summary Create or update an Asset Filter + * + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, accountName, assetName, filterName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, assetName, filterName, 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 Create or update an Asset Filter + * + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AssetFilter} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilter} for more information. + * + * {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, accountName, assetName, filterName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, assetName, filterName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, accountName, assetName, filterName, parameters, options, optionalCallback); + } + } + + /** + * @summary Delete an Asset Filter. + * + * Deletes an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, accountName, assetName, filterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, accountName, assetName, filterName, 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 Asset Filter. + * + * Deletes an Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter 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. + */ + deleteMethod(resourceGroupName, accountName, assetName, filterName, options, optionalCallback) { + 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, accountName, assetName, filterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, accountName, assetName, filterName, options, optionalCallback); + } + } + + /** + * @summary Update an Asset Filter + * + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, accountName, assetName, filterName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, assetName, filterName, 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 Update an Asset Filter + * + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {string} filterName The Asset Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AssetFilter} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilter} for more information. + * + * {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, accountName, assetName, filterName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, assetName, filterName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, accountName, assetName, filterName, parameters, options, optionalCallback); + } + } + + /** + * @summary List Asset Filters + * + * List Asset Filters associated with the specified Asset. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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 Asset Filters + * + * List Asset Filters associated with the specified Asset. + * + * @param {string} nextPageLink The NextLink from the previous 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 {AssetFilterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilterCollection} for more information. + * + * {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 = AssetFilters; diff --git a/lib/services/mediaServicesManagement/lib/operations/assets.js b/lib/services/mediaServicesManagement/lib/operations/assets.js index ccfe8a1d40..1824289b85 100644 --- a/lib/services/mediaServicesManagement/lib/operations/assets.js +++ b/lib/services/mediaServicesManagement/lib/operations/assets.js @@ -1076,8 +1076,8 @@ function _listContainerSas(resourceGroupName, accountName, assetName, parameters * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link AssetStorageEncryptionKey} for more - * information. + * See {@link StorageEncryptedAssetDecryptionData} for + * more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1193,7 +1193,163 @@ function _getEncryptionKey(resourceGroupName, accountName, assetName, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AssetStorageEncryptionKey']().mapper(); + let resultMapper = new client.models['StorageEncryptedAssetDecryptionData']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 Streaming Locators + * + * Lists Streaming Locators which are associated with this asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset 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 ListStreamingLocatorsResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listStreamingLocators(resourceGroupName, accountName, assetName, options, callback) { + /* jshint validthis: true */ + let 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (assetName === null || assetName === undefined || typeof assetName.valueOf() !== 'string') { + throw new Error('assetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/listStreamingLocators'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{assetName}', encodeURIComponent(assetName)); + let queryParameters = []; + queryParameters.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['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ListStreamingLocatorsResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1354,6 +1510,7 @@ class Assets { this._update = _update; this._listContainerSas = _listContainerSas; this._getEncryptionKey = _getEncryptionKey; + this._listStreamingLocators = _listStreamingLocators; this._listNext = _listNext; } @@ -2032,7 +2189,7 @@ class Assets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2075,7 +2232,7 @@ class Assets { * * {Promise} A promise is returned * - * @resolve {AssetStorageEncryptionKey} - The deserialized result object. + * @resolve {StorageEncryptedAssetDecryptionData} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2084,8 +2241,8 @@ class Assets { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link AssetStorageEncryptionKey} for more - * information. + * See {@link StorageEncryptedAssetDecryptionData} for + * more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2111,6 +2268,103 @@ class Assets { } } + /** + * @summary List Streaming Locators + * + * Lists Streaming Locators which are associated with this asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset 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. + */ + listStreamingLocatorsWithHttpOperationResponse(resourceGroupName, accountName, assetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listStreamingLocators(resourceGroupName, accountName, assetName, 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 Streaming Locators + * + * Lists Streaming Locators which are associated with this asset. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset 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 {ListStreamingLocatorsResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ListStreamingLocatorsResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listStreamingLocators(resourceGroupName, accountName, assetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listStreamingLocators(resourceGroupName, accountName, assetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listStreamingLocators(resourceGroupName, accountName, assetName, options, optionalCallback); + } + } + /** * @summary List Assets * diff --git a/lib/services/mediaServicesManagement/lib/operations/index.d.ts b/lib/services/mediaServicesManagement/lib/operations/index.d.ts index 7f7ad07fa6..4ea57795a0 100644 --- a/lib/services/mediaServicesManagement/lib/operations/index.d.ts +++ b/lib/services/mediaServicesManagement/lib/operations/index.d.ts @@ -15,17 +15,22 @@ import * as models from '../models'; /** * @class - * Operations + * AccountFilters * __NOTE__: An instance of this class is automatically created for an * instance of the AzureMediaServices. */ -export interface Operations { +export interface AccountFilters { /** - * @summary List Operations + * @summary List Account Filters * - * Lists all the Media Services operations. + * List Account Filters in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. * * @param {object} [options] Optional Parameters. * @@ -34,16 +39,21 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List Operations + * @summary List Account Filters * - * Lists all the Media Services operations. + * List Account Filters in the Media Services account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. * * @param {object} [options] Optional Parameters. * @@ -57,7 +67,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationCollection} - The deserialized result object. + * @resolve {AccountFilterCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -65,25 +75,30 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationCollection} [result] - The deserialized result object if an error did not occur. - * See {@link OperationCollection} for more information. + * {AccountFilterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilterCollection} for more + * information. * * {WebResource} [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; + list(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List Operations + * @summary Get an Account Filter. * - * Lists all the Media Services operations. + * Get the details of an Account Filter in the Media Services account. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name * * @param {object} [options] Optional Parameters. * @@ -92,19 +107,23 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, accountName: string, filterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List Operations + * @summary Get an Account Filter. * - * Lists all the Media Services operations. + * Get the details of an Account Filter in the Media Services account. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name * * @param {object} [options] Optional Parameters. * @@ -118,7 +137,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationCollection} - The deserialized result object. + * @resolve {AccountFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -126,35 +145,59 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationCollection} [result] - The deserialized result object if an error did not occur. - * See {@link OperationCollection} for more information. + * {AccountFilter} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilter} for more information. * * {WebResource} [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 - * Mediaservices - * __NOTE__: An instance of this class is automatically created for an - * instance of the AzureMediaServices. - */ -export interface Mediaservices { + get(resourceGroupName: string, accountName: string, filterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, filterName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, filterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List Media Services accounts + * @summary Create or update an Account Filter * - * List Media Services accounts in the resource group + * Creates or updates an Account Filter in the Media Services account. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -162,20 +205,53 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, filterName: string, parameters: models.AccountFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List Media Services accounts + * @summary Create or update an Account Filter * - * List Media Services accounts in the resource group + * Creates or updates an Account Filter in the Media Services account. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. * + * @param {string} accountName The Media Services account name. + * + * @param {string} filterName The Account Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -188,7 +264,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {MediaServiceCollection} - The deserialized result object. + * @resolve {AccountFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -196,29 +272,30 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MediaServiceCollection} [result] - The deserialized result object if an error did not occur. - * See {@link MediaServiceCollection} for more - * information. + * {AccountFilter} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilter} for more information. * * {WebResource} [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(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, filterName: string, parameters: models.AccountFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, filterName: string, parameters: models.AccountFilter, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, filterName: string, parameters: models.AccountFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Get a Media Services account + * @summary Delete an Account Filter. * - * Get the details of a Media Services account + * Deletes an Account Filter in the Media Services account. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. * * @param {string} accountName The Media Services account name. * + * @param {string} filterName The Account Filter name + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -226,22 +303,24 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, accountName: string, filterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get a Media Services account + * @summary Delete an Account Filter. * - * Get the details of a Media Services account + * Deletes an Account Filter in the Media Services account. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. * * @param {string} accountName The Media Services account name. * + * @param {string} filterName The Account Filter name + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -254,7 +333,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {MediaService} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -262,36 +341,57 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MediaService} [result] - The deserialized result object if an error did not occur. - * See {@link MediaService} for more information. + * {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. */ - get(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, filterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, filterName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, filterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Create or update a Media Services account + * @summary Update an Account Filter * - * Creates or updates a Media Services account + * Updates an existing Account Filter in the Media Services account. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. * * @param {string} accountName The Media Services account name. * + * @param {string} filterName The Account Filter name + * * @param {object} parameters The request parameters * - * @param {array} [parameters.storageAccounts] The storage accounts for this - * resource. + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. * - * @param {object} [parameters.tags] Resource tags. + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. * - * @param {string} [parameters.location] The Azure Region of the resource. + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. * * @param {object} [options] Optional Parameters. * @@ -300,30 +400,52 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.MediaService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, accountName: string, filterName: string, parameters: models.AccountFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Create or update a Media Services account + * @summary Update an Account Filter * - * Creates or updates a Media Services account + * Updates an existing Account Filter in the Media Services account. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. * * @param {string} accountName The Media Services account name. * + * @param {string} filterName The Account Filter name + * * @param {object} parameters The request parameters * - * @param {array} [parameters.storageAccounts] The storage accounts for this - * resource. + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. * - * @param {object} [parameters.tags] Resource tags. + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. * - * @param {string} [parameters.location] The Azure Region of the resource. + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. * * @param {object} [options] Optional Parameters. * @@ -337,7 +459,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {MediaService} - The deserialized result object. + * @resolve {AccountFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -345,27 +467,25 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MediaService} [result] - The deserialized result object if an error did not occur. - * See {@link MediaService} for more information. + * {AccountFilter} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilter} for more information. * * {WebResource} [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, accountName: string, parameters: models.MediaService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, accountName: string, parameters: models.MediaService, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, parameters: models.MediaService, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, filterName: string, parameters: models.AccountFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, filterName: string, parameters: models.AccountFilter, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, filterName: string, parameters: models.AccountFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Delete a Media Services account. - * - * Deletes a Media Services account + * @summary List Account Filters * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. + * List Account Filters in the Media Services account. * - * @param {string} accountName The Media Services account name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -374,21 +494,19 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Delete a Media Services account. - * - * Deletes a Media Services account + * @summary List Account Filters * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. + * List Account Filters in the Media Services account. * - * @param {string} accountName The Media Services account name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -402,7 +520,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {AccountFilterCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -410,35 +528,32 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {AccountFilterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AccountFilterCollection} for more + * information. * * {WebResource} [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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMediaServices. + */ +export interface Operations { /** - * @summary Update a Media Services account - * - * Updates an existing Media Services account - * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. - * - * @param {string} accountName The Media Services account name. - * - * @param {object} parameters The request parameters - * - * @param {array} [parameters.storageAccounts] The storage accounts for this - * resource. - * - * @param {object} [parameters.tags] Resource tags. + * @summary List Operations * - * @param {string} [parameters.location] The Azure Region of the resource. + * Lists all the Media Services operations. * * @param {object} [options] Optional Parameters. * @@ -447,30 +562,16 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.MediaService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Update a Media Services account - * - * Updates an existing Media Services account - * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. - * - * @param {string} accountName The Media Services account name. - * - * @param {object} parameters The request parameters - * - * @param {array} [parameters.storageAccounts] The storage accounts for this - * resource. - * - * @param {object} [parameters.tags] Resource tags. + * @summary List Operations * - * @param {string} [parameters.location] The Azure Region of the resource. + * Lists all the Media Services operations. * * @param {object} [options] Optional Parameters. * @@ -484,7 +585,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {MediaService} - The deserialized result object. + * @resolve {OperationCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -492,32 +593,459 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MediaService} [result] - The deserialized result object if an error did not occur. - * See {@link MediaService} for more information. + * {OperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link OperationCollection} for more information. * * {WebResource} [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, accountName: string, parameters: models.MediaService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, accountName: string, parameters: models.MediaService, callback: ServiceCallback): void; - update(resourceGroupName: string, accountName: string, parameters: models.MediaService, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Synchronizes Storage Account Keys - * - * Synchronizes storage account keys for a storage account associated with the - * Media Service account. - * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. - * - * @param {string} accountName The Media Services account name. + * @summary List Operations * - * @param {object} parameters The request parameters + * Lists all the Media Services operations. * - * @param {string} [parameters.id] The ID of the storage account resource. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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 Operations + * + * Lists all the Media Services operations. + * + * @param {string} nextPageLink The NextLink from the 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 {OperationCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link OperationCollection} for more information. + * + * {WebResource} [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 + * Mediaservices + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMediaServices. + */ +export interface Mediaservices { + + + /** + * @summary List Media Services accounts + * + * List Media Services accounts in the resource group + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure 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(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Media Services accounts + * + * List Media Services accounts in the resource group + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure 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 {MediaServiceCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MediaServiceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link MediaServiceCollection} for more + * information. + * + * {WebResource} [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(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a Media Services account + * + * Get the details of a Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account 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. + */ + getWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a Media Services account + * + * Get the details of a Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account 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 {MediaService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MediaService} [result] - The deserialized result object if an error did not occur. + * See {@link MediaService} for more information. + * + * {WebResource} [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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a Media Services account + * + * Creates or updates a Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {object} parameters The request parameters + * + * @param {array} [parameters.storageAccounts] The storage accounts for this + * resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region of the 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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.MediaService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a Media Services account + * + * Creates or updates a Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {object} parameters The request parameters + * + * @param {array} [parameters.storageAccounts] The storage accounts for this + * resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region of the 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 {MediaService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MediaService} [result] - The deserialized result object if an error did not occur. + * See {@link MediaService} for more information. + * + * {WebResource} [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, accountName: string, parameters: models.MediaService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, parameters: models.MediaService, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, parameters: models.MediaService, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a Media Services account. + * + * Deletes a Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a Media Services account. + * + * Deletes a Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account 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. + */ + deleteMethod(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Update a Media Services account + * + * Updates an existing Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {object} parameters The request parameters + * + * @param {array} [parameters.storageAccounts] The storage accounts for this + * resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region of the 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, accountName: string, parameters: models.MediaService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Update a Media Services account + * + * Updates an existing Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {object} parameters The request parameters + * + * @param {array} [parameters.storageAccounts] The storage accounts for this + * resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region of the 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 {MediaService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MediaService} [result] - The deserialized result object if an error did not occur. + * See {@link MediaService} for more information. + * + * {WebResource} [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, accountName: string, parameters: models.MediaService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, parameters: models.MediaService, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, parameters: models.MediaService, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Synchronizes Storage Account Keys + * + * Synchronizes storage account keys for a storage account associated with the + * Media Service account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.id] The ID of the storage account resource. * * @param {object} [options] Optional Parameters. * @@ -530,22 +1058,598 @@ export interface Mediaservices { * * @reject {Error|ServiceError} - The error object. */ - syncStorageKeysWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.SyncStorageKeysInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + syncStorageKeysWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.SyncStorageKeysInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Synchronizes Storage Account Keys + * + * Synchronizes storage account keys for a storage account associated with the + * Media Service account. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.id] The ID of the storage account 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. + */ + syncStorageKeys(resourceGroupName: string, accountName: string, parameters: models.SyncStorageKeysInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + syncStorageKeys(resourceGroupName: string, accountName: string, parameters: models.SyncStorageKeysInput, callback: ServiceCallback): void; + syncStorageKeys(resourceGroupName: string, accountName: string, parameters: models.SyncStorageKeysInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List Media Services accounts + * + * List Media Services accounts 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. + */ + listBySubscriptionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Media Services accounts + * + * List Media Services accounts 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 {SubscriptionMediaServiceCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SubscriptionMediaServiceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionMediaServiceCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscription(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscription(callback: ServiceCallback): void; + listBySubscription(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a Media Services account + * + * Get the details of a Media Services account + * + * @param {string} accountName The Media Services account 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. + */ + getBySubscriptionWithHttpOperationResponse(accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a Media Services account + * + * Get the details of a Media Services account + * + * @param {string} accountName The Media Services account 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 {SubscriptionMediaService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SubscriptionMediaService} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionMediaService} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getBySubscription(accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBySubscription(accountName: string, callback: ServiceCallback): void; + getBySubscription(accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List Media Services accounts + * + * List Media Services accounts in the 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. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Media Services accounts + * + * List Media Services accounts in the 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 {MediaServiceCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MediaServiceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link MediaServiceCollection} for more + * information. + * + * {WebResource} [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 Media Services accounts + * + * List Media Services accounts 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. + */ + listBySubscriptionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Media Services accounts + * + * List Media Services accounts 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 {SubscriptionMediaServiceCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SubscriptionMediaServiceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionMediaServiceCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscriptionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscriptionNext(nextPageLink: string, callback: ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Locations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMediaServices. + */ +export interface Locations { + + + /** + * @summary Check Name Availability + * + * Checks whether the Media Service resource name is available. + * + * @param {string} locationName The name of the location + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.name] The account name. + * + * @param {string} [parameters.type] The account type. For a Media Services + * account, this should be 'MediaServices'. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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(locationName: string, parameters: models.CheckNameAvailabilityInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Check Name Availability + * + * Checks whether the Media Service resource name is available. + * + * @param {string} locationName The name of the location + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.name] The account name. + * + * @param {string} [parameters.type] The account type. For a Media Services + * account, this should be 'MediaServices'. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {EntityNameAvailabilityCheckOutput} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {EntityNameAvailabilityCheckOutput} [result] - The deserialized result object if an error did not occur. + * See {@link EntityNameAvailabilityCheckOutput} for more + * information. + * + * {WebResource} [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(locationName: string, parameters: models.CheckNameAvailabilityInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(locationName: string, parameters: models.CheckNameAvailabilityInput, callback: ServiceCallback): void; + checkNameAvailability(locationName: string, parameters: models.CheckNameAvailabilityInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Assets + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMediaServices. + */ +export interface Assets { + + + /** + * @summary List Assets + * + * List Assets in the Media Services account with optional filtering and + * ordering + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Restricts the set of items returned. + * + * @param {number} [options.top] Specifies a non-negative integer n that limits + * the number of items returned from a collection. The service returns the + * number of available items up to but not greater than the specified value n. + * + * @param {string} [options.orderby] Specifies the the key by which the result + * collection should be ordered. + * + * @param {object} [options.customHeaders] Headers that 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(resourceGroupName: string, accountName: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Assets + * + * List Assets in the Media Services account with optional filtering and + * ordering + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Restricts the set of items returned. + * + * @param {number} [options.top] Specifies a non-negative integer n that limits + * the number of items returned from a collection. The service returns the + * number of available items up to but not greater than the specified value n. + * + * @param {string} [options.orderby] Specifies the the key by which the result + * collection should be ordered. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {AssetCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {AssetCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AssetCollection} for more information. + * + * {WebResource} [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(resourceGroupName: string, accountName: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get an Asset + * + * Get the details of an Asset in the Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset 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. + */ + getWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Synchronizes Storage Account Keys + * @summary Get an Asset * - * Synchronizes storage account keys for a storage account associated with the - * Media Service account. + * Get the details of an Asset in the Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset 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 {Asset} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Asset} [result] - The deserialized result object if an error did not occur. + * See {@link Asset} for more information. + * + * {WebResource} [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, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, assetName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, assetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update an Asset + * + * Creates or updates an Asset in the Media Services account * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. * * @param {string} accountName The Media Services account name. * + * @param {string} assetName The Asset name. + * * @param {object} parameters The request parameters * - * @param {string} [parameters.id] The ID of the storage account resource. + * @param {string} [parameters.alternateId] The alternate ID of the Asset. + * + * @param {string} [parameters.description] The Asset description. + * + * @param {string} [parameters.container] The name of the asset blob container. + * + * @param {string} [parameters.storageAccountName] The name of the storage + * account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, accountName: string, assetName: string, parameters: models.Asset, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update an Asset + * + * Creates or updates an Asset in the Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.alternateId] The alternate ID of the Asset. + * + * @param {string} [parameters.description] The Asset description. + * + * @param {string} [parameters.container] The name of the asset blob container. + * + * @param {string} [parameters.storageAccountName] The name of the storage + * account. * * @param {object} [options] Optional Parameters. * @@ -559,7 +1663,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Asset} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -567,21 +1671,29 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {Asset} [result] - The deserialized result object if an error did not occur. + * See {@link Asset} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - syncStorageKeys(resourceGroupName: string, accountName: string, parameters: models.SyncStorageKeysInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - syncStorageKeys(resourceGroupName: string, accountName: string, parameters: models.SyncStorageKeysInput, callback: ServiceCallback): void; - syncStorageKeys(resourceGroupName: string, accountName: string, parameters: models.SyncStorageKeysInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List Media Services accounts + * @summary Delete an Asset. * - * List Media Services accounts in the subscription. + * Deletes an Asset in the Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. * * @param {object} [options] Optional Parameters. * @@ -590,16 +1702,23 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBySubscriptionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List Media Services accounts + * @summary Delete an Asset. * - * List Media Services accounts in the subscription. + * Deletes an Asset in the Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. * * @param {object} [options] Optional Parameters. * @@ -613,7 +1732,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {SubscriptionMediaServiceCollection} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -621,26 +1740,40 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionMediaServiceCollection} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionMediaServiceCollection} for more - * information. + * {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. */ - listBySubscription(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySubscription(callback: ServiceCallback): void; - listBySubscription(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, assetName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, assetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Get a Media Services account + * @summary Update an Asset * - * Get the details of a Media Services account + * Updates an existing Asset in the Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. * * @param {string} accountName The Media Services account name. * + * @param {string} assetName The Asset name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.alternateId] The alternate ID of the Asset. + * + * @param {string} [parameters.description] The Asset description. + * + * @param {string} [parameters.container] The name of the asset blob container. + * + * @param {string} [parameters.storageAccountName] The name of the storage + * account. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -648,19 +1781,35 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getBySubscriptionWithHttpOperationResponse(accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get a Media Services account + * @summary Update an Asset * - * Get the details of a Media Services account + * Updates an existing Asset in the Media Services account + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. * * @param {string} accountName The Media Services account name. * + * @param {string} assetName The Asset name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.alternateId] The alternate ID of the Asset. + * + * @param {string} [parameters.description] The Asset description. + * + * @param {string} [parameters.container] The name of the asset blob container. + * + * @param {string} [parameters.storageAccountName] The name of the storage + * account. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -673,7 +1822,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {SubscriptionMediaService} - The deserialized result object. + * @resolve {Asset} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -681,26 +1830,39 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionMediaService} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionMediaService} for more - * information. + * {Asset} [result] - The deserialized result object if an error did not occur. + * See {@link Asset} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getBySubscription(accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBySubscription(accountName: string, callback: ServiceCallback): void; - getBySubscription(accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List Media Services accounts + * @summary List the Asset URLs * - * List Media Services accounts in the resource group + * Lists storage container URLs with shared access signatures (SAS) for + * uploading and downloading Asset content. The signatures are derived from the + * storage account keys. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.permissions] The permissions to set on the SAS + * URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete' + * + * @param {date} [parameters.expiryTime] The SAS URL expiration time. This + * must be less than 24 hours from the current time. * * @param {object} [options] Optional Parameters. * @@ -709,19 +1871,33 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listContainerSasWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, parameters: models.ListContainerSasInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List Media Services accounts + * @summary List the Asset URLs + * + * Lists storage container URLs with shared access signatures (SAS) for + * uploading and downloading Asset content. The signatures are derived from the + * storage account keys. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. * - * List Media Services accounts in the resource group + * @param {object} parameters The request parameters * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [parameters.permissions] The permissions to set on the SAS + * URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete' + * + * @param {date} [parameters.expiryTime] The SAS URL expiration time. This + * must be less than 24 hours from the current time. * * @param {object} [options] Optional Parameters. * @@ -735,7 +1911,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {MediaServiceCollection} - The deserialized result object. + * @resolve {AssetContainerSas} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -743,26 +1919,30 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MediaServiceCollection} [result] - The deserialized result object if an error did not occur. - * See {@link MediaServiceCollection} for more - * information. + * {AssetContainerSas} [result] - The deserialized result object if an error did not occur. + * See {@link AssetContainerSas} for more information. * * {WebResource} [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; + listContainerSas(resourceGroupName: string, accountName: string, assetName: string, parameters: models.ListContainerSasInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listContainerSas(resourceGroupName: string, accountName: string, assetName: string, parameters: models.ListContainerSasInput, callback: ServiceCallback): void; + listContainerSas(resourceGroupName: string, accountName: string, assetName: string, parameters: models.ListContainerSasInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List Media Services accounts + * @summary Gets the Asset storage key * - * List Media Services accounts in the subscription. + * Gets the Asset storage encryption keys used to decrypt content created by + * version 2 of the Media Services API * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. * * @param {object} [options] Optional Parameters. * @@ -771,19 +1951,24 @@ export interface Mediaservices { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBySubscriptionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getEncryptionKeyWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List Media Services accounts + * @summary Gets the Asset storage key * - * List Media Services accounts in the subscription. + * Gets the Asset storage encryption keys used to decrypt content created by + * version 2 of the Media Services API * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} assetName The Asset name. * * @param {object} [options] Optional Parameters. * @@ -797,7 +1982,7 @@ export interface Mediaservices { * * {Promise} A promise is returned. * - * @resolve {SubscriptionMediaServiceCollection} - The deserialized result object. + * @resolve {StorageEncryptedAssetDecryptionData} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -805,41 +1990,30 @@ export interface Mediaservices { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionMediaServiceCollection} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionMediaServiceCollection} for more - * information. + * {StorageEncryptedAssetDecryptionData} [result] - The deserialized result object if an error did not occur. + * See {@link StorageEncryptedAssetDecryptionData} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBySubscriptionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySubscriptionNext(nextPageLink: string, callback: ServiceCallback): void; - listBySubscriptionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Locations - * __NOTE__: An instance of this class is automatically created for an - * instance of the AzureMediaServices. - */ -export interface Locations { + getEncryptionKey(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getEncryptionKey(resourceGroupName: string, accountName: string, assetName: string, callback: ServiceCallback): void; + getEncryptionKey(resourceGroupName: string, accountName: string, assetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Check Name Availability - * - * Checks whether the Media Service resource name is available. + * @summary List Streaming Locators * - * @param {string} locationName + * Lists Streaming Locators which are associated with this asset. * - * @param {object} parameters The request parameters + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. * - * @param {string} [parameters.name] The account name. + * @param {string} accountName The Media Services account name. * - * @param {string} [parameters.type] The account type. For a Media Services - * account, this should be 'MediaServices'. + * @param {string} assetName The Asset name. * * @param {object} [options] Optional Parameters. * @@ -848,25 +2022,23 @@ export interface Locations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - checkNameAvailabilityWithHttpOperationResponse(locationName: string, parameters: models.CheckNameAvailabilityInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listStreamingLocatorsWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Check Name Availability - * - * Checks whether the Media Service resource name is available. + * @summary List Streaming Locators * - * @param {string} locationName + * Lists Streaming Locators which are associated with this asset. * - * @param {object} parameters The request parameters + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. * - * @param {string} [parameters.name] The account name. + * @param {string} accountName The Media Services account name. * - * @param {string} [parameters.type] The account type. For a Media Services - * account, this should be 'MediaServices'. + * @param {string} assetName The Asset name. * * @param {object} [options] Optional Parameters. * @@ -880,7 +2052,7 @@ export interface Locations { * * {Promise} A promise is returned. * - * @resolve {EntityNameAvailabilityCheckOutput} - The deserialized result object. + * @resolve {ListStreamingLocatorsResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -888,26 +2060,17 @@ export interface Locations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EntityNameAvailabilityCheckOutput} [result] - The deserialized result object if an error did not occur. - * See {@link EntityNameAvailabilityCheckOutput} for more + * {ListStreamingLocatorsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ListStreamingLocatorsResponse} for more * information. * * {WebResource} [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(locationName: string, parameters: models.CheckNameAvailabilityInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkNameAvailability(locationName: string, parameters: models.CheckNameAvailabilityInput, callback: ServiceCallback): void; - checkNameAvailability(locationName: string, parameters: models.CheckNameAvailabilityInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Assets - * __NOTE__: An instance of this class is automatically created for an - * instance of the AzureMediaServices. - */ -export interface Assets { + listStreamingLocators(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listStreamingLocators(resourceGroupName: string, accountName: string, assetName: string, callback: ServiceCallback): void; + listStreamingLocators(resourceGroupName: string, accountName: string, assetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -916,22 +2079,11 @@ export interface Assets { * List Assets in the Media Services account with optional filtering and * ordering * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. - * - * @param {string} accountName The Media Services account name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] Restricts the set of items returned. - * - * @param {number} [options.top] Specifies a non-negative integer n that limits - * the number of items returned from a collection. The service returns the - * number of available items up to but not greater than the specified value n. - * - * @param {string} [options.orderby] Specifies the the key by which the result - * collection should be ordered. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -941,7 +2093,7 @@ export interface Assets { * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary List Assets @@ -949,22 +2101,11 @@ export interface Assets { * List Assets in the Media Services account with optional filtering and * ordering * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. - * - * @param {string} accountName The Media Services account name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] Restricts the set of items returned. - * - * @param {number} [options.top] Specifies a non-negative integer n that limits - * the number of items returned from a collection. The service returns the - * number of available items up to but not greater than the specified value n. - * - * @param {string} [options.orderby] Specifies the the key by which the result - * collection should be ordered. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -990,15 +2131,24 @@ export interface Assets { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, accountName: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, accountName: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * AssetFilters + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMediaServices. + */ +export interface AssetFilters { /** - * @summary Get an Asset + * @summary List Asset Filters * - * Get the details of an Asset in the Media Services account + * List Asset Filters associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1014,16 +2164,16 @@ export interface Assets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get an Asset + * @summary List Asset Filters * - * Get the details of an Asset in the Media Services account + * List Asset Filters associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1044,7 +2194,7 @@ export interface Assets { * * {Promise} A promise is returned. * - * @resolve {Asset} - The deserialized result object. + * @resolve {AssetFilterCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1052,22 +2202,22 @@ export interface Assets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Asset} [result] - The deserialized result object if an error did not occur. - * See {@link Asset} for more information. + * {AssetFilterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilterCollection} for more information. * * {WebResource} [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, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, accountName: string, assetName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, accountName: string, assetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, accountName: string, assetName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, accountName: string, assetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Create or update an Asset + * @summary Get an Asset Filter. * - * Creates or updates an Asset in the Media Services account + * Get the details of an Asset Filter associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1076,16 +2226,7 @@ export interface Assets { * * @param {string} assetName The Asset name. * - * @param {object} parameters The request parameters - * - * @param {string} [parameters.alternateId] The alternate ID of the Asset. - * - * @param {string} [parameters.description] The Asset description. - * - * @param {string} [parameters.container] The name of the asset blob container. - * - * @param {string} [parameters.storageAccountName] The name of the storage - * account. + * @param {string} filterName The Asset Filter name * * @param {object} [options] Optional Parameters. * @@ -1094,16 +2235,16 @@ export interface Assets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, filterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Create or update an Asset + * @summary Get an Asset Filter. * - * Creates or updates an Asset in the Media Services account + * Get the details of an Asset Filter associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1112,16 +2253,7 @@ export interface Assets { * * @param {string} assetName The Asset name. * - * @param {object} parameters The request parameters - * - * @param {string} [parameters.alternateId] The alternate ID of the Asset. - * - * @param {string} [parameters.description] The Asset description. - * - * @param {string} [parameters.container] The name of the asset blob container. - * - * @param {string} [parameters.storageAccountName] The name of the storage - * account. + * @param {string} filterName The Asset Filter name * * @param {object} [options] Optional Parameters. * @@ -1135,7 +2267,7 @@ export interface Assets { * * {Promise} A promise is returned. * - * @resolve {Asset} - The deserialized result object. + * @resolve {AssetFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1143,47 +2275,22 @@ export interface Assets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Asset} [result] - The deserialized result object if an error did not occur. - * See {@link Asset} for more information. + * {AssetFilter} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilter} for more information. * * {WebResource} [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, accountName: string, assetName: string, parameters: models.Asset, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + get(resourceGroupName: string, accountName: string, assetName: string, filterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, assetName: string, filterName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, assetName: string, filterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * @summary Delete an Asset. - * - * Deletes an Asset in the Media Services account - * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. - * - * @param {string} accountName The Media Services account name. - * - * @param {string} assetName The Asset 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Delete an Asset. + * @summary Create or update an Asset Filter * - * Deletes an Asset in the Media Services account + * Creates or updates an Asset Filter associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1192,59 +2299,36 @@ export interface Assets { * * @param {string} assetName The Asset 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. + * @param {string} filterName The Asset Filter name * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} parameters The request parameters * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, accountName: string, assetName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, assetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Update an Asset + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. * - * Updates an existing Asset in the Media Services account + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. * - * @param {string} resourceGroupName The name of the resource group within the - * Azure subscription. + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. * - * @param {string} accountName The Media Services account name. + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. * - * @param {string} assetName The Asset name. + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. * - * @param {object} parameters The request parameters + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. * - * @param {string} [parameters.alternateId] The alternate ID of the Asset. + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. * - * @param {string} [parameters.description] The Asset description. + * @param {object} [parameters.firstQuality] The first quality. * - * @param {string} [parameters.container] The name of the asset blob container. + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. * - * @param {string} [parameters.storageAccountName] The name of the storage - * account. + * @param {array} [parameters.tracks] The tracks selection conditions. * * @param {object} [options] Optional Parameters. * @@ -1253,16 +2337,16 @@ export interface Assets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, filterName: string, parameters: models.AssetFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Update an Asset + * @summary Create or update an Asset Filter * - * Updates an existing Asset in the Media Services account + * Creates or updates an Asset Filter associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1271,16 +2355,36 @@ export interface Assets { * * @param {string} assetName The Asset name. * + * @param {string} filterName The Asset Filter name + * * @param {object} parameters The request parameters * - * @param {string} [parameters.alternateId] The alternate ID of the Asset. + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. * - * @param {string} [parameters.description] The Asset description. + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. * - * @param {string} [parameters.container] The name of the asset blob container. + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. * - * @param {string} [parameters.storageAccountName] The name of the storage - * account. + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. * * @param {object} [options] Optional Parameters. * @@ -1294,7 +2398,7 @@ export interface Assets { * * {Promise} A promise is returned. * - * @resolve {Asset} - The deserialized result object. + * @resolve {AssetFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1302,24 +2406,22 @@ export interface Assets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Asset} [result] - The deserialized result object if an error did not occur. - * See {@link Asset} for more information. + * {AssetFilter} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilter} for more information. * * {WebResource} [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, accountName: string, assetName: string, parameters: models.Asset, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, callback: ServiceCallback): void; - update(resourceGroupName: string, accountName: string, assetName: string, parameters: models.Asset, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, assetName: string, filterName: string, parameters: models.AssetFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, assetName: string, filterName: string, parameters: models.AssetFilter, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, assetName: string, filterName: string, parameters: models.AssetFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List the Asset URLs + * @summary Delete an Asset Filter. * - * Lists storage container URLs with shared access signatures (SAS) for - * uploading and downloading Asset content. The signatures are derived from the - * storage account keys. + * Deletes an Asset Filter associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1328,13 +2430,7 @@ export interface Assets { * * @param {string} assetName The Asset name. * - * @param {object} parameters The request parameters - * - * @param {string} [parameters.permissions] The permissions to set on the SAS - * URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete' - * - * @param {date} [parameters.expiryTime] The SAS URL expiration time. This - * must be less than 24 hours from the current time. + * @param {string} filterName The Asset Filter name * * @param {object} [options] Optional Parameters. * @@ -1343,18 +2439,16 @@ export interface Assets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listContainerSasWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, parameters: models.ListContainerSasInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, filterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List the Asset URLs + * @summary Delete an Asset Filter. * - * Lists storage container URLs with shared access signatures (SAS) for - * uploading and downloading Asset content. The signatures are derived from the - * storage account keys. + * Deletes an Asset Filter associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1363,13 +2457,7 @@ export interface Assets { * * @param {string} assetName The Asset name. * - * @param {object} parameters The request parameters - * - * @param {string} [parameters.permissions] The permissions to set on the SAS - * URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete' - * - * @param {date} [parameters.expiryTime] The SAS URL expiration time. This - * must be less than 24 hours from the current time. + * @param {string} filterName The Asset Filter name * * @param {object} [options] Optional Parameters. * @@ -1383,7 +2471,7 @@ export interface Assets { * * {Promise} A promise is returned. * - * @resolve {AssetContainerSas} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1391,23 +2479,21 @@ export interface Assets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AssetContainerSas} [result] - The deserialized result object if an error did not occur. - * See {@link AssetContainerSas} for more information. + * {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. */ - listContainerSas(resourceGroupName: string, accountName: string, assetName: string, parameters: models.ListContainerSasInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listContainerSas(resourceGroupName: string, accountName: string, assetName: string, parameters: models.ListContainerSasInput, callback: ServiceCallback): void; - listContainerSas(resourceGroupName: string, accountName: string, assetName: string, parameters: models.ListContainerSasInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, assetName: string, filterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, assetName: string, filterName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, assetName: string, filterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets the Asset storage key + * @summary Update an Asset Filter * - * Gets the Asset storage encryption keys used to decrypt content created by - * version 2 of the Media Services API + * Updates an existing Asset Filter associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1416,6 +2502,37 @@ export interface Assets { * * @param {string} assetName The Asset name. * + * @param {string} filterName The Asset Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1423,17 +2540,16 @@ export interface Assets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getEncryptionKeyWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, accountName: string, assetName: string, filterName: string, parameters: models.AssetFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the Asset storage key + * @summary Update an Asset Filter * - * Gets the Asset storage encryption keys used to decrypt content created by - * version 2 of the Media Services API + * Updates an existing Asset Filter associated with the specified Asset. * * @param {string} resourceGroupName The name of the resource group within the * Azure subscription. @@ -1442,6 +2558,37 @@ export interface Assets { * * @param {string} assetName The Asset name. * + * @param {string} filterName The Asset Filter name + * + * @param {object} parameters The request parameters + * + * @param {object} [parameters.presentationTimeRange] The presentation time + * range. + * + * @param {number} parameters.presentationTimeRange.startTimestamp The absolute + * start time boundary. + * + * @param {number} parameters.presentationTimeRange.endTimestamp The absolute + * end time boundary. + * + * @param {number} parameters.presentationTimeRange.presentationWindowDuration + * The relative to end sliding window. + * + * @param {number} parameters.presentationTimeRange.liveBackoffDuration The + * relative to end right edge. + * + * @param {number} parameters.presentationTimeRange.timescale The time scale of + * time stamps. + * + * @param {boolean} parameters.presentationTimeRange.forceEndTimestamp The + * indicator of forcing exsiting of end time stamp. + * + * @param {object} [parameters.firstQuality] The first quality. + * + * @param {number} parameters.firstQuality.bitrate The first quality bitrate. + * + * @param {array} [parameters.tracks] The tracks selection conditions. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1454,7 +2601,7 @@ export interface Assets { * * {Promise} A promise is returned. * - * @resolve {AssetStorageEncryptionKey} - The deserialized result object. + * @resolve {AssetFilter} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1462,24 +2609,22 @@ export interface Assets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AssetStorageEncryptionKey} [result] - The deserialized result object if an error did not occur. - * See {@link AssetStorageEncryptionKey} for more - * information. + * {AssetFilter} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilter} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getEncryptionKey(resourceGroupName: string, accountName: string, assetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getEncryptionKey(resourceGroupName: string, accountName: string, assetName: string, callback: ServiceCallback): void; - getEncryptionKey(resourceGroupName: string, accountName: string, assetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, assetName: string, filterName: string, parameters: models.AssetFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, assetName: string, filterName: string, parameters: models.AssetFilter, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, assetName: string, filterName: string, parameters: models.AssetFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List Assets + * @summary List Asset Filters * - * List Assets in the Media Services account with optional filtering and - * ordering + * List Asset Filters associated with the specified Asset. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1491,17 +2636,16 @@ export interface Assets { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List Assets + * @summary List Asset Filters * - * List Assets in the Media Services account with optional filtering and - * ordering + * List Asset Filters associated with the specified Asset. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1518,7 +2662,7 @@ export interface Assets { * * {Promise} A promise is returned. * - * @resolve {AssetCollection} - The deserialized result object. + * @resolve {AssetFilterCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1526,16 +2670,16 @@ export interface Assets { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AssetCollection} [result] - The deserialized result object if an error did not occur. - * See {@link AssetCollection} for more information. + * {AssetFilterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AssetFilterCollection} for more information. * * {WebResource} [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; + 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; } /** @@ -2716,13 +3860,6 @@ export interface Jobs { * * @param {object} parameters.input The inputs for the Job. * - * @param {string} [parameters.input.label] A label that is assigned to a - * JobInput, that is used to satisfy a reference used in the Transform. For - * example, a Transform can be authored so as to take an image file with the - * label 'xyz' and apply it as an overlay onto the input video before it is - * encoded. When submitting a Job, exactly one of the JobInputs should be the - * image file, and it should have the label 'xyz'. - * * @param {string} parameters.input.odatatype Polymorphic Discriminator * * @param {array} parameters.outputs The outputs for the Job. @@ -2733,7 +3870,7 @@ export interface Jobs { * 'High' * * @param {object} [parameters.correlationData] Customer provided correlation - * data that will be returned in Job completed events. + * data that will be returned in Job and JobOutput state events. * * @param {object} [options] Optional Parameters. * @@ -2769,13 +3906,6 @@ export interface Jobs { * * @param {object} parameters.input The inputs for the Job. * - * @param {string} [parameters.input.label] A label that is assigned to a - * JobInput, that is used to satisfy a reference used in the Transform. For - * example, a Transform can be authored so as to take an image file with the - * label 'xyz' and apply it as an overlay onto the input video before it is - * encoded. When submitting a Job, exactly one of the JobInputs should be the - * image file, and it should have the label 'xyz'. - * * @param {string} parameters.input.odatatype Polymorphic Discriminator * * @param {array} parameters.outputs The outputs for the Job. @@ -2786,7 +3916,7 @@ export interface Jobs { * 'High' * * @param {object} [parameters.correlationData] Customer provided correlation - * data that will be returned in Job completed events. + * data that will be returned in Job and JobOutput state events. * * @param {object} [options] Optional Parameters. * @@ -2892,6 +4022,117 @@ export interface Jobs { deleteMethod(resourceGroupName: string, accountName: string, transformName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Update Job + * + * Updates a Job. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} transformName The Transform name. + * + * @param {string} jobName The Job name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.description] Optional customer supplied + * description of the Job. + * + * @param {object} parameters.input The inputs for the Job. + * + * @param {string} parameters.input.odatatype Polymorphic Discriminator + * + * @param {array} parameters.outputs The outputs for the Job. + * + * @param {string} [parameters.priority] Priority with which the job should be + * processed. Higher priority jobs are processed before lower priority jobs. If + * not set, the default is normal. Possible values include: 'Low', 'Normal', + * 'High' + * + * @param {object} [parameters.correlationData] Customer provided correlation + * data that will be returned in Job and JobOutput state events. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, accountName: string, transformName: string, jobName: string, parameters: models.Job, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Update Job + * + * Updates a Job. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} transformName The Transform name. + * + * @param {string} jobName The Job name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.description] Optional customer supplied + * description of the Job. + * + * @param {object} parameters.input The inputs for the Job. + * + * @param {string} parameters.input.odatatype Polymorphic Discriminator + * + * @param {array} parameters.outputs The outputs for the Job. + * + * @param {string} [parameters.priority] Priority with which the job should be + * processed. Higher priority jobs are processed before lower priority jobs. If + * not set, the default is normal. Possible values include: 'Low', 'Normal', + * 'High' + * + * @param {object} [parameters.correlationData] Customer provided correlation + * data that will be returned in Job and JobOutput state events. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Job} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Job} [result] - The deserialized result object if an error did not occur. + * See {@link Job} for more information. + * + * {WebResource} [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, accountName: string, transformName: string, jobName: string, parameters: models.Job, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, transformName: string, jobName: string, parameters: models.Job, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, transformName: string, jobName: string, parameters: models.Job, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Cancel Job * @@ -3814,33 +5055,30 @@ export interface StreamingLocators { * * @param {string} parameters.assetName Asset Name * - * @param {date} [parameters.startTime] StartTime of Streaming Locator + * @param {date} [parameters.startTime] The start time of the Streaming + * Locator. * - * @param {date} [parameters.endTime] EndTime of Streaming Locator + * @param {date} [parameters.endTime] The end time of the Streaming Locator. * - * @param {uuid} [parameters.streamingLocatorId] StreamingLocatorId of - * Streaming Locator + * @param {uuid} [parameters.streamingLocatorId] The StreamingLocatorId of the + * Streaming Locator. * - * @param {string} parameters.streamingPolicyName Streaming policy name used by - * this streaming locator. Either specify the name of streaming policy you - * created or use one of the predefined streaming polices. The predefined - * streaming policies available are: 'Predefined_DownloadOnly', + * @param {string} parameters.streamingPolicyName Name of the Streaming Policy + * used by this Streaming Locator. Either specify the name of Streaming Policy + * you created or use one of the predefined Streaming Policies. The predefined + * Streaming Policies available are: 'Predefined_DownloadOnly', * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', - * 'Predefined_ClearKey', 'Predefined_SecureStreaming' and - * 'Predefined_SecureStreamingWithFairPlay' + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming' * - * @param {string} [parameters.defaultContentKeyPolicyName] Default - * ContentKeyPolicy used by this Streaming Locator + * @param {string} [parameters.defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. * - * @param {array} [parameters.contentKeys] ContentKeys used by this Streaming - * Locator + * @param {array} [parameters.contentKeys] The ContentKeys used by this + * Streaming Locator. * - * @param {string} [parameters.alternativeMediaId] An Alternative Media - * Identifier associated with the StreamingLocator. This identifier can be - * used to distinguish different StreamingLocators for the same Asset for - * authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the - * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the - * StreamingPolicyName field. + * @param {string} [parameters.alternativeMediaId] Alternative Media ID of this + * Streaming Locator * * @param {object} [options] Optional Parameters. * @@ -3871,33 +5109,30 @@ export interface StreamingLocators { * * @param {string} parameters.assetName Asset Name * - * @param {date} [parameters.startTime] StartTime of Streaming Locator + * @param {date} [parameters.startTime] The start time of the Streaming + * Locator. * - * @param {date} [parameters.endTime] EndTime of Streaming Locator + * @param {date} [parameters.endTime] The end time of the Streaming Locator. * - * @param {uuid} [parameters.streamingLocatorId] StreamingLocatorId of - * Streaming Locator + * @param {uuid} [parameters.streamingLocatorId] The StreamingLocatorId of the + * Streaming Locator. * - * @param {string} parameters.streamingPolicyName Streaming policy name used by - * this streaming locator. Either specify the name of streaming policy you - * created or use one of the predefined streaming polices. The predefined - * streaming policies available are: 'Predefined_DownloadOnly', + * @param {string} parameters.streamingPolicyName Name of the Streaming Policy + * used by this Streaming Locator. Either specify the name of Streaming Policy + * you created or use one of the predefined Streaming Policies. The predefined + * Streaming Policies available are: 'Predefined_DownloadOnly', * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', - * 'Predefined_ClearKey', 'Predefined_SecureStreaming' and - * 'Predefined_SecureStreamingWithFairPlay' + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming' * - * @param {string} [parameters.defaultContentKeyPolicyName] Default - * ContentKeyPolicy used by this Streaming Locator + * @param {string} [parameters.defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. * - * @param {array} [parameters.contentKeys] ContentKeys used by this Streaming - * Locator + * @param {array} [parameters.contentKeys] The ContentKeys used by this + * Streaming Locator. * - * @param {string} [parameters.alternativeMediaId] An Alternative Media - * Identifier associated with the StreamingLocator. This identifier can be - * used to distinguish different StreamingLocators for the same Asset for - * authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the - * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the - * StreamingPolicyName field. + * @param {string} [parameters.alternativeMediaId] Alternative Media ID of this + * Streaming Locator * * @param {object} [options] Optional Parameters. * @@ -4362,12 +5597,21 @@ export interface LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -4385,25 +5629,31 @@ export interface LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -4414,9 +5664,12 @@ export interface LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -4424,8 +5677,8 @@ export interface LiveEvents { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4457,12 +5710,21 @@ export interface LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -4480,25 +5742,31 @@ export interface LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -4509,9 +5777,12 @@ export interface LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -4519,8 +5790,8 @@ export interface LiveEvents { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4569,12 +5840,21 @@ export interface LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -4592,25 +5872,31 @@ export interface LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -4621,9 +5907,12 @@ export interface LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -4659,12 +5948,21 @@ export interface LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -4682,25 +5980,31 @@ export interface LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -4711,9 +6015,12 @@ export interface LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -5052,12 +6359,21 @@ export interface LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -5075,25 +6391,31 @@ export interface LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -5104,9 +6426,12 @@ export interface LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -5114,8 +6439,8 @@ export interface LiveEvents { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5147,12 +6472,21 @@ export interface LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -5170,25 +6504,31 @@ export interface LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -5199,9 +6539,12 @@ export interface LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -5209,8 +6552,8 @@ export interface LiveEvents { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5259,12 +6602,21 @@ export interface LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -5282,25 +6634,31 @@ export interface LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -5311,9 +6669,12 @@ export interface LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -5349,12 +6710,21 @@ export interface LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -5372,25 +6742,31 @@ export interface LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -5401,9 +6777,12 @@ export interface LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -5959,7 +7338,8 @@ export interface LiveOutputs { * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -6005,7 +7385,8 @@ export interface LiveOutputs { * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -6142,7 +7523,8 @@ export interface LiveOutputs { * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -6188,7 +7570,8 @@ export interface LiveOutputs { * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -6522,9 +7905,12 @@ export interface StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -6567,8 +7953,8 @@ export interface StreamingEndpoints { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6597,9 +7983,12 @@ export interface StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -6642,8 +8031,8 @@ export interface StreamingEndpoints { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6691,9 +8080,12 @@ export interface StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -6763,9 +8155,12 @@ export interface StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -7056,8 +8451,8 @@ export interface StreamingEndpoints { * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * @@ -7086,8 +8481,8 @@ export interface StreamingEndpoints { * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * @@ -7136,9 +8531,12 @@ export interface StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -7181,8 +8579,8 @@ export interface StreamingEndpoints { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7211,9 +8609,12 @@ export interface StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -7256,8 +8657,8 @@ export interface StreamingEndpoints { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7305,9 +8706,12 @@ export interface StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -7377,9 +8781,12 @@ export interface StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -7670,8 +9077,8 @@ export interface StreamingEndpoints { * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * @@ -7700,8 +9107,8 @@ export interface StreamingEndpoints { * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/mediaServicesManagement/lib/operations/index.js b/lib/services/mediaServicesManagement/lib/operations/index.js index 15fc3b4985..9175bf91ae 100644 --- a/lib/services/mediaServicesManagement/lib/operations/index.js +++ b/lib/services/mediaServicesManagement/lib/operations/index.js @@ -14,10 +14,12 @@ 'use strict'; +exports.AccountFilters = require('./accountFilters'); exports.Operations = require('./operations'); exports.Mediaservices = require('./mediaservices'); exports.Locations = require('./locations'); exports.Assets = require('./assets'); +exports.AssetFilters = require('./assetFilters'); exports.ContentKeyPolicies = require('./contentKeyPolicies'); exports.Transforms = require('./transforms'); exports.Jobs = require('./jobs'); diff --git a/lib/services/mediaServicesManagement/lib/operations/jobs.js b/lib/services/mediaServicesManagement/lib/operations/jobs.js index 0c62f3d462..c1da33dcfe 100644 --- a/lib/services/mediaServicesManagement/lib/operations/jobs.js +++ b/lib/services/mediaServicesManagement/lib/operations/jobs.js @@ -382,13 +382,6 @@ function _get(resourceGroupName, accountName, transformName, jobName, options, c * * @param {object} parameters.input The inputs for the Job. * - * @param {string} [parameters.input.label] A label that is assigned to a - * JobInput, that is used to satisfy a reference used in the Transform. For - * example, a Transform can be authored so as to take an image file with the - * label 'xyz' and apply it as an overlay onto the input video before it is - * encoded. When submitting a Job, exactly one of the JobInputs should be the - * image file, and it should have the label 'xyz'. - * * @param {string} parameters.input.odatatype Polymorphic Discriminator * * @param {array} parameters.outputs The outputs for the Job. @@ -399,7 +392,7 @@ function _get(resourceGroupName, accountName, transformName, jobName, options, c * 'High' * * @param {object} [parameters.correlationData] Customer provided correlation - * data that will be returned in Job completed events. + * data that will be returned in Job and JobOutput state events. * * @param {object} [options] Optional Parameters. * @@ -708,6 +701,203 @@ function _deleteMethod(resourceGroupName, accountName, transformName, jobName, o }); } +/** + * @summary Update Job + * + * Updates a Job. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} transformName The Transform name. + * + * @param {string} jobName The Job name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.description] Optional customer supplied + * description of the Job. + * + * @param {object} parameters.input The inputs for the Job. + * + * @param {string} parameters.input.odatatype Polymorphic Discriminator + * + * @param {array} parameters.outputs The outputs for the Job. + * + * @param {string} [parameters.priority] Priority with which the job should be + * processed. Higher priority jobs are processed before lower priority jobs. If + * not set, the default is normal. Possible values include: 'Low', 'Normal', + * 'High' + * + * @param {object} [parameters.correlationData] Customer provided correlation + * data that will be returned in Job and JobOutput state events. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Job} for more information. + * + * {object} [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, accountName, transformName, jobName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (transformName === null || transformName === undefined || typeof transformName.valueOf() !== 'string') { + throw new Error('transformName cannot be null or undefined and it must be of type string.'); + } + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{transformName}', encodeURIComponent(transformName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Job']().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['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Job']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * @summary Cancel Job * @@ -993,6 +1183,7 @@ class Jobs { this._get = _get; this._create = _create; this._deleteMethod = _deleteMethod; + this._update = _update; this._cancelJob = _cancelJob; this._listNext = _listNext; } @@ -1234,13 +1425,6 @@ class Jobs { * * @param {object} parameters.input The inputs for the Job. * - * @param {string} [parameters.input.label] A label that is assigned to a - * JobInput, that is used to satisfy a reference used in the Transform. For - * example, a Transform can be authored so as to take an image file with the - * label 'xyz' and apply it as an overlay onto the input video before it is - * encoded. When submitting a Job, exactly one of the JobInputs should be the - * image file, and it should have the label 'xyz'. - * * @param {string} parameters.input.odatatype Polymorphic Discriminator * * @param {array} parameters.outputs The outputs for the Job. @@ -1251,7 +1435,7 @@ class Jobs { * 'High' * * @param {object} [parameters.correlationData] Customer provided correlation - * data that will be returned in Job completed events. + * data that will be returned in Job and JobOutput state events. * * @param {object} [options] Optional Parameters. * @@ -1299,13 +1483,6 @@ class Jobs { * * @param {object} parameters.input The inputs for the Job. * - * @param {string} [parameters.input.label] A label that is assigned to a - * JobInput, that is used to satisfy a reference used in the Transform. For - * example, a Transform can be authored so as to take an image file with the - * label 'xyz' and apply it as an overlay onto the input video before it is - * encoded. When submitting a Job, exactly one of the JobInputs should be the - * image file, and it should have the label 'xyz'. - * * @param {string} parameters.input.odatatype Polymorphic Discriminator * * @param {array} parameters.outputs The outputs for the Job. @@ -1316,7 +1493,7 @@ class Jobs { * 'High' * * @param {object} [parameters.correlationData] Customer provided correlation - * data that will be returned in Job completed events. + * data that will be returned in Job and JobOutput state events. * * @param {object} [options] Optional Parameters. * @@ -1464,6 +1641,144 @@ class Jobs { } } + /** + * @summary Update Job + * + * Updates a Job. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} transformName The Transform name. + * + * @param {string} jobName The Job name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.description] Optional customer supplied + * description of the Job. + * + * @param {object} parameters.input The inputs for the Job. + * + * @param {string} parameters.input.odatatype Polymorphic Discriminator + * + * @param {array} parameters.outputs The outputs for the Job. + * + * @param {string} [parameters.priority] Priority with which the job should be + * processed. Higher priority jobs are processed before lower priority jobs. If + * not set, the default is normal. Possible values include: 'Low', 'Normal', + * 'High' + * + * @param {object} [parameters.correlationData] Customer provided correlation + * data that will be returned in Job and JobOutput state events. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, accountName, transformName, jobName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, transformName, jobName, 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 Update Job + * + * Updates a Job. + * + * @param {string} resourceGroupName The name of the resource group within the + * Azure subscription. + * + * @param {string} accountName The Media Services account name. + * + * @param {string} transformName The Transform name. + * + * @param {string} jobName The Job name. + * + * @param {object} parameters The request parameters + * + * @param {string} [parameters.description] Optional customer supplied + * description of the Job. + * + * @param {object} parameters.input The inputs for the Job. + * + * @param {string} parameters.input.odatatype Polymorphic Discriminator + * + * @param {array} parameters.outputs The outputs for the Job. + * + * @param {string} [parameters.priority] Priority with which the job should be + * processed. Higher priority jobs are processed before lower priority jobs. If + * not set, the default is normal. Possible values include: 'Low', 'Normal', + * 'High' + * + * @param {object} [parameters.correlationData] Customer provided correlation + * data that will be returned in Job and JobOutput state events. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Job} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Job} for more information. + * + * {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, accountName, transformName, jobName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, transformName, jobName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, accountName, transformName, jobName, parameters, options, optionalCallback); + } + } + /** * @summary Cancel Job * diff --git a/lib/services/mediaServicesManagement/lib/operations/liveEvents.js b/lib/services/mediaServicesManagement/lib/operations/liveEvents.js index 1736729334..8d14f649a2 100644 --- a/lib/services/mediaServicesManagement/lib/operations/liveEvents.js +++ b/lib/services/mediaServicesManagement/lib/operations/liveEvents.js @@ -352,12 +352,21 @@ function _get(resourceGroupName, accountName, liveEventName, options, callback) * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -375,25 +384,31 @@ function _get(resourceGroupName, accountName, liveEventName, options, callback) * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -404,9 +419,12 @@ function _get(resourceGroupName, accountName, liveEventName, options, callback) * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -414,8 +432,8 @@ function _get(resourceGroupName, accountName, liveEventName, options, callback) * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -503,12 +521,21 @@ function _create(resourceGroupName, accountName, liveEventName, parameters, opti * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -526,25 +553,31 @@ function _create(resourceGroupName, accountName, liveEventName, parameters, opti * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -555,9 +588,12 @@ function _create(resourceGroupName, accountName, liveEventName, parameters, opti * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -929,12 +965,21 @@ function _reset(resourceGroupName, accountName, liveEventName, options, callback * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -952,25 +997,31 @@ function _reset(resourceGroupName, accountName, liveEventName, options, callback * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -981,9 +1032,12 @@ function _reset(resourceGroupName, accountName, liveEventName, options, callback * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -991,8 +1045,8 @@ function _reset(resourceGroupName, accountName, liveEventName, options, callback * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1207,12 +1261,21 @@ function _beginCreate(resourceGroupName, accountName, liveEventName, parameters, * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -1230,25 +1293,31 @@ function _beginCreate(resourceGroupName, accountName, liveEventName, parameters, * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -1259,9 +1328,12 @@ function _beginCreate(resourceGroupName, accountName, liveEventName, parameters, * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -2446,12 +2518,21 @@ class LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -2469,25 +2550,31 @@ class LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -2498,9 +2585,12 @@ class LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -2508,8 +2598,8 @@ class LiveEvents { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2553,12 +2643,21 @@ class LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -2576,25 +2675,31 @@ class LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -2605,9 +2710,12 @@ class LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -2615,8 +2723,8 @@ class LiveEvents { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2680,12 +2788,21 @@ class LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -2703,25 +2820,31 @@ class LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -2732,9 +2855,12 @@ class LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -2782,12 +2908,21 @@ class LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -2805,25 +2940,31 @@ class LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -2834,9 +2975,12 @@ class LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -3298,12 +3442,21 @@ class LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -3321,25 +3474,31 @@ class LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -3350,9 +3509,12 @@ class LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -3360,8 +3522,8 @@ class LiveEvents { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3405,12 +3567,21 @@ class LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -3428,25 +3599,31 @@ class LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -3457,9 +3634,12 @@ class LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -3467,8 +3647,8 @@ class LiveEvents { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3532,12 +3712,21 @@ class LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -3555,25 +3744,31 @@ class LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -3584,9 +3779,12 @@ class LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * @@ -3634,12 +3832,21 @@ class LiveEvents { * @param {object} parameters.input The Live Event input. * * @param {string} parameters.input.streamingProtocol The streaming protocol - * for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + * for the Live Event. This is specified at creation time and cannot be + * updated. Possible values include: 'FragmentedMP4', 'RTMP' + * + * @param {object} [parameters.input.accessControl] The access control for + * LiveEvent Input. + * + * @param {object} [parameters.input.accessControl.ip] The IP access control + * properties. * * @param {string} [parameters.input.keyFrameIntervalDuration] ISO 8601 * timespan duration of the key frame interval duration. * - * @param {string} [parameters.input.accessToken] The access token. + * @param {string} [parameters.input.accessToken] A unique identifier for a + * stream. This can be specified at creation time but cannot be updated. If + * omitted, the service will generate a unique value. * * @param {array} [parameters.input.endpoints] The input endpoints for the Live * Event. @@ -3657,25 +3864,31 @@ class LiveEvents { * @param {array} [parameters.preview.accessControl.ip.allow] The IP allow * list. * - * @param {string} [parameters.preview.previewLocator] The preview locator - * Guid. + * @param {string} [parameters.preview.previewLocator] The identifier of the + * preview locator in Guid format. Specifying this at creation time allows the + * caller to know the preview locator url before the event is created. If + * omitted, the service will generate a random identifier. This value cannot + * be updated once the live event is created. * * @param {string} [parameters.preview.streamingPolicyName] The name of - * streaming policy used for LiveEvent preview + * streaming policy used for the LiveEvent preview. This value is specified at + * creation time and cannot be updated. * * @param {string} [parameters.preview.alternativeMediaId] An Alternative Media - * Identifier associated with the preview url. This identifier can be used to - * distinguish the preview of different live events for authorization purposes - * in the CustomLicenseAcquisitionUrlTemplate or the + * Identifier associated with the StreamingLocator created for the preview. + * This value is specified at creation time and cannot be updated. The + * identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the * StreamingPolicyName field. * * @param {object} [parameters.encoding] The Live Event encoding. * * @param {string} [parameters.encoding.encodingType] The encoding type for - * Live Event. Possible values include: 'None', 'Basic' + * Live Event. This value is specified at creation time and cannot be updated. + * Possible values include: 'None', 'Basic' * * @param {string} [parameters.encoding.presetName] The encoding preset name. + * This value is specified at creation time and cannot be updated. * * @param {object} [parameters.crossSiteAccessPolicies] The Live Event access * policies. @@ -3686,9 +3899,12 @@ class LiveEvents { * @param {string} [parameters.crossSiteAccessPolicies.crossDomainPolicy] The * content of crossdomain.xml used by Silverlight. * - * @param {boolean} [parameters.vanityUrl] The Live Event vanity URL flag. + * @param {boolean} [parameters.vanityUrl] Specifies whether to use a vanity + * url with the Live Event. This value is specified at creation time and + * cannot be updated. * - * @param {array} [parameters.streamOptions] The stream options. + * @param {array} [parameters.streamOptions] The options to use for the + * LiveEvent. This value is specified at creation time and cannot be updated. * * @param {object} [parameters.tags] Resource tags. * diff --git a/lib/services/mediaServicesManagement/lib/operations/liveOutputs.js b/lib/services/mediaServicesManagement/lib/operations/liveOutputs.js index 893c958a87..aaecac4dee 100644 --- a/lib/services/mediaServicesManagement/lib/operations/liveOutputs.js +++ b/lib/services/mediaServicesManagement/lib/operations/liveOutputs.js @@ -398,7 +398,8 @@ function _get(resourceGroupName, accountName, liveEventName, liveOutputName, opt * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -571,7 +572,8 @@ function _deleteMethod(resourceGroupName, accountName, liveEventName, liveOutput * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -1327,7 +1329,8 @@ class LiveOutputs { * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -1385,7 +1388,8 @@ class LiveOutputs { * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -1564,7 +1568,8 @@ class LiveOutputs { * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * @@ -1622,7 +1627,8 @@ class LiveOutputs { * duration of the archive window length. This is duration that customer want * to retain the recorded content. * - * @param {string} [parameters.manifestName] The manifest file name. + * @param {string} [parameters.manifestName] The manifest file name. If not + * provided, the service will generate one automatically. * * @param {object} [parameters.hls] The HLS configuration. * diff --git a/lib/services/mediaServicesManagement/lib/operations/locations.js b/lib/services/mediaServicesManagement/lib/operations/locations.js index d0d9e2f25d..18c3a43b3b 100644 --- a/lib/services/mediaServicesManagement/lib/operations/locations.js +++ b/lib/services/mediaServicesManagement/lib/operations/locations.js @@ -19,7 +19,7 @@ const WebResource = msRest.WebResource; * * Checks whether the Media Service resource name is available. * - * @param {string} locationName + * @param {string} locationName The name of the location * * @param {object} parameters The request parameters * @@ -197,7 +197,7 @@ class Locations { * * Checks whether the Media Service resource name is available. * - * @param {string} locationName + * @param {string} locationName The name of the location * * @param {object} parameters The request parameters * @@ -236,7 +236,7 @@ class Locations { * * Checks whether the Media Service resource name is available. * - * @param {string} locationName + * @param {string} locationName The name of the location * * @param {object} parameters The request parameters * diff --git a/lib/services/mediaServicesManagement/lib/operations/streamingEndpoints.js b/lib/services/mediaServicesManagement/lib/operations/streamingEndpoints.js index 0eb0ce9ffe..c888697f57 100644 --- a/lib/services/mediaServicesManagement/lib/operations/streamingEndpoints.js +++ b/lib/services/mediaServicesManagement/lib/operations/streamingEndpoints.js @@ -350,9 +350,12 @@ function _get(resourceGroupName, accountName, streamingEndpointName, options, ca * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -395,8 +398,8 @@ function _get(resourceGroupName, accountName, streamingEndpointName, options, ca * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -483,9 +486,12 @@ function _create(resourceGroupName, accountName, streamingEndpointName, paramete * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -815,8 +821,8 @@ function _stop(resourceGroupName, accountName, streamingEndpointName, options, c * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * @@ -889,9 +895,12 @@ function _scale(resourceGroupName, accountName, streamingEndpointName, parameter * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -934,8 +943,8 @@ function _scale(resourceGroupName, accountName, streamingEndpointName, parameter * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1149,9 +1158,12 @@ function _beginCreate(resourceGroupName, accountName, streamingEndpointName, par * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -1850,8 +1862,8 @@ function _beginStop(resourceGroupName, accountName, streamingEndpointName, optio * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * @@ -2370,9 +2382,12 @@ class StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -2415,8 +2430,8 @@ class StreamingEndpoints { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2457,9 +2472,12 @@ class StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -2502,8 +2520,8 @@ class StreamingEndpoints { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2566,9 +2584,12 @@ class StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -2650,9 +2671,12 @@ class StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -3039,8 +3063,8 @@ class StreamingEndpoints { * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * @@ -3081,8 +3105,8 @@ class StreamingEndpoints { * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * @@ -3146,9 +3170,12 @@ class StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -3191,8 +3218,8 @@ class StreamingEndpoints { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3233,9 +3260,12 @@ class StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -3278,8 +3308,8 @@ class StreamingEndpoints { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.autoStart] The flag indicates if auto start the - * Live Event. + * @param {boolean} [options.autoStart] The flag indicates if the resource + * should be automatically started on creation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3342,9 +3372,12 @@ class StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -3426,9 +3459,12 @@ class StreamingEndpoints { * * @param {string} [parameters.description] The StreamingEndpoint description. * - * @param {number} [parameters.scaleUnits] The number of scale units. + * @param {number} parameters.scaleUnits The number of scale units. Use the + * Scale operation to adjust this value. * - * @param {string} [parameters.availabilitySetName] AvailabilitySet name + * @param {string} [parameters.availabilitySetName] The name of the + * AvailabilitySet used with this StreamingEndpoint for high availability + * streaming. This value can only be set at creation time. * * @param {object} [parameters.accessControl] The access control definition of * the StreamingEndpoint. @@ -3815,8 +3851,8 @@ class StreamingEndpoints { * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * @@ -3857,8 +3893,8 @@ class StreamingEndpoints { * * @param {object} parameters StreamingEndpoint scale parameters * - * @param {number} [parameters.scaleUnit] ScaleUnit The scale unit number of - * the StreamingEndpoint. + * @param {number} [parameters.scaleUnit] The scale unit number of the + * StreamingEndpoint. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/mediaServicesManagement/lib/operations/streamingLocators.js b/lib/services/mediaServicesManagement/lib/operations/streamingLocators.js index e9f0facb6d..59ff071a5f 100644 --- a/lib/services/mediaServicesManagement/lib/operations/streamingLocators.js +++ b/lib/services/mediaServicesManagement/lib/operations/streamingLocators.js @@ -365,33 +365,30 @@ function _get(resourceGroupName, accountName, streamingLocatorName, options, cal * * @param {string} parameters.assetName Asset Name * - * @param {date} [parameters.startTime] StartTime of Streaming Locator + * @param {date} [parameters.startTime] The start time of the Streaming + * Locator. * - * @param {date} [parameters.endTime] EndTime of Streaming Locator + * @param {date} [parameters.endTime] The end time of the Streaming Locator. * - * @param {uuid} [parameters.streamingLocatorId] StreamingLocatorId of - * Streaming Locator + * @param {uuid} [parameters.streamingLocatorId] The StreamingLocatorId of the + * Streaming Locator. * - * @param {string} parameters.streamingPolicyName Streaming policy name used by - * this streaming locator. Either specify the name of streaming policy you - * created or use one of the predefined streaming polices. The predefined - * streaming policies available are: 'Predefined_DownloadOnly', + * @param {string} parameters.streamingPolicyName Name of the Streaming Policy + * used by this Streaming Locator. Either specify the name of Streaming Policy + * you created or use one of the predefined Streaming Policies. The predefined + * Streaming Policies available are: 'Predefined_DownloadOnly', * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', - * 'Predefined_ClearKey', 'Predefined_SecureStreaming' and - * 'Predefined_SecureStreamingWithFairPlay' + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming' * - * @param {string} [parameters.defaultContentKeyPolicyName] Default - * ContentKeyPolicy used by this Streaming Locator + * @param {string} [parameters.defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. * - * @param {array} [parameters.contentKeys] ContentKeys used by this Streaming - * Locator + * @param {array} [parameters.contentKeys] The ContentKeys used by this + * Streaming Locator. * - * @param {string} [parameters.alternativeMediaId] An Alternative Media - * Identifier associated with the StreamingLocator. This identifier can be - * used to distinguish different StreamingLocators for the same Asset for - * authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the - * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the - * StreamingPolicyName field. + * @param {string} [parameters.alternativeMediaId] Alternative Media ID of this + * Streaming Locator * * @param {object} [options] Optional Parameters. * @@ -1372,33 +1369,30 @@ class StreamingLocators { * * @param {string} parameters.assetName Asset Name * - * @param {date} [parameters.startTime] StartTime of Streaming Locator + * @param {date} [parameters.startTime] The start time of the Streaming + * Locator. * - * @param {date} [parameters.endTime] EndTime of Streaming Locator + * @param {date} [parameters.endTime] The end time of the Streaming Locator. * - * @param {uuid} [parameters.streamingLocatorId] StreamingLocatorId of - * Streaming Locator + * @param {uuid} [parameters.streamingLocatorId] The StreamingLocatorId of the + * Streaming Locator. * - * @param {string} parameters.streamingPolicyName Streaming policy name used by - * this streaming locator. Either specify the name of streaming policy you - * created or use one of the predefined streaming polices. The predefined - * streaming policies available are: 'Predefined_DownloadOnly', + * @param {string} parameters.streamingPolicyName Name of the Streaming Policy + * used by this Streaming Locator. Either specify the name of Streaming Policy + * you created or use one of the predefined Streaming Policies. The predefined + * Streaming Policies available are: 'Predefined_DownloadOnly', * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', - * 'Predefined_ClearKey', 'Predefined_SecureStreaming' and - * 'Predefined_SecureStreamingWithFairPlay' + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming' * - * @param {string} [parameters.defaultContentKeyPolicyName] Default - * ContentKeyPolicy used by this Streaming Locator + * @param {string} [parameters.defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. * - * @param {array} [parameters.contentKeys] ContentKeys used by this Streaming - * Locator + * @param {array} [parameters.contentKeys] The ContentKeys used by this + * Streaming Locator. * - * @param {string} [parameters.alternativeMediaId] An Alternative Media - * Identifier associated with the StreamingLocator. This identifier can be - * used to distinguish different StreamingLocators for the same Asset for - * authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the - * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the - * StreamingPolicyName field. + * @param {string} [parameters.alternativeMediaId] Alternative Media ID of this + * Streaming Locator * * @param {object} [options] Optional Parameters. * @@ -1441,33 +1435,30 @@ class StreamingLocators { * * @param {string} parameters.assetName Asset Name * - * @param {date} [parameters.startTime] StartTime of Streaming Locator + * @param {date} [parameters.startTime] The start time of the Streaming + * Locator. * - * @param {date} [parameters.endTime] EndTime of Streaming Locator + * @param {date} [parameters.endTime] The end time of the Streaming Locator. * - * @param {uuid} [parameters.streamingLocatorId] StreamingLocatorId of - * Streaming Locator + * @param {uuid} [parameters.streamingLocatorId] The StreamingLocatorId of the + * Streaming Locator. * - * @param {string} parameters.streamingPolicyName Streaming policy name used by - * this streaming locator. Either specify the name of streaming policy you - * created or use one of the predefined streaming polices. The predefined - * streaming policies available are: 'Predefined_DownloadOnly', + * @param {string} parameters.streamingPolicyName Name of the Streaming Policy + * used by this Streaming Locator. Either specify the name of Streaming Policy + * you created or use one of the predefined Streaming Policies. The predefined + * Streaming Policies available are: 'Predefined_DownloadOnly', * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', - * 'Predefined_ClearKey', 'Predefined_SecureStreaming' and - * 'Predefined_SecureStreamingWithFairPlay' + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming' * - * @param {string} [parameters.defaultContentKeyPolicyName] Default - * ContentKeyPolicy used by this Streaming Locator + * @param {string} [parameters.defaultContentKeyPolicyName] Name of the default + * ContentKeyPolicy used by this Streaming Locator. * - * @param {array} [parameters.contentKeys] ContentKeys used by this Streaming - * Locator + * @param {array} [parameters.contentKeys] The ContentKeys used by this + * Streaming Locator. * - * @param {string} [parameters.alternativeMediaId] An Alternative Media - * Identifier associated with the StreamingLocator. This identifier can be - * used to distinguish different StreamingLocators for the same Asset for - * authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the - * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the - * StreamingPolicyName field. + * @param {string} [parameters.alternativeMediaId] Alternative Media ID of this + * Streaming Locator * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/mediaServicesManagement/package.json b/lib/services/mediaServicesManagement/package.json index 5a30a7a4ae..4baeb8c971 100644 --- a/lib/services/mediaServicesManagement/package.json +++ b/lib/services/mediaServicesManagement/package.json @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/azureMediaServices.js", "types": "./lib/azureMediaServices.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } diff --git a/lib/services/resourceManagement/LICENSE.txt b/lib/services/resourceManagement/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/resourceManagement/LICENSE.txt +++ b/lib/services/resourceManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 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. \ No newline at end of file +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/resourceManagement/lib/feature/featureClient.d.ts b/lib/services/resourceManagement/lib/feature/featureClient.d.ts index 2357a212c4..343b6a3923 100644 --- a/lib/services/resourceManagement/lib/feature/featureClient.d.ts +++ b/lib/services/resourceManagement/lib/feature/featureClient.d.ts @@ -8,11 +8,12 @@ * regenerated. */ -import { ServiceClientCredentials } from 'ms-rest'; +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"; -declare class FeatureClient extends AzureServiceClient { +export default class FeatureClient extends AzureServiceClient { /** * Initializes a new instance of the FeatureClient class. * @constructor @@ -33,11 +34,11 @@ declare class FeatureClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -56,6 +57,114 @@ declare class FeatureClient extends AzureServiceClient { // Operation groups features: operations.Features; + + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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; + + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {string} nextPageLink The NextLink from the 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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; } -export = FeatureClient; +export { FeatureClient, models as FeatureModels }; diff --git a/lib/services/resourceManagement/lib/feature/featureClient.js b/lib/services/resourceManagement/lib/feature/featureClient.js index a7bce0cc90..d8f5a7bb50 100644 --- a/lib/services/resourceManagement/lib/feature/featureClient.js +++ b/lib/services/resourceManagement/lib/feature/featureClient.js @@ -17,11 +17,268 @@ 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'); +/** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {object} [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; + 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.Features/operations'; + 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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 OperationListResult} for more information. + * + * {object} [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; + 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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 FeatureClient. */ class FeatureClient extends ServiceClient { /** @@ -34,9 +291,9 @@ class FeatureClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -74,9 +331,176 @@ class FeatureClient extends ServiceClient { } this.features = new operations.Features(this); this.models = models; + this._listOperations = _listOperations; + this._listOperationsNext = _listOperationsNext; msRest.addSerializationMixin(this); } + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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; + 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); + } + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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; + 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 = FeatureClient; +module.exports['default'] = FeatureClient; +module.exports.FeatureClient = FeatureClient; +module.exports.FeatureModels = models; diff --git a/lib/services/resourceManagement/lib/feature/models/featureResult.js b/lib/services/resourceManagement/lib/feature/models/featureResult.js index 2f79c02d21..20c86d44a2 100644 --- a/lib/services/resourceManagement/lib/feature/models/featureResult.js +++ b/lib/services/resourceManagement/lib/feature/models/featureResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Previewed feature information. * diff --git a/lib/services/resourceManagement/lib/feature/models/index.d.ts b/lib/services/resourceManagement/lib/feature/models/index.d.ts index ec61d6ea0b..1ecde30033 100644 --- a/lib/services/resourceManagement/lib/feature/models/index.d.ts +++ b/lib/services/resourceManagement/lib/feature/models/index.d.ts @@ -49,6 +49,56 @@ export interface FeatureResult { type?: string; } +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * The object that represents the operation. + * + * @member {string} [provider] Service provider: Microsoft.Features + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Microsoft.Features operation + * + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Features + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + */ +export interface Operation { + name?: string; + display?: OperationDisplay; +} + + +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor + * Result of the request to list Microsoft.Features operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface OperationListResult extends Array { + nextLink?: string; +} /** * @class diff --git a/lib/services/resourceManagement/lib/feature/models/index.js b/lib/services/resourceManagement/lib/feature/models/index.js index 4c6deea212..80319edab8 100644 --- a/lib/services/resourceManagement/lib/feature/models/index.js +++ b/lib/services/resourceManagement/lib/feature/models/index.js @@ -20,4 +20,7 @@ exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.FeatureProperties = require('./featureProperties'); exports.FeatureResult = require('./featureResult'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.OperationListResult = require('./operationListResult'); exports.FeatureOperationsListResult = require('./featureOperationsListResult'); diff --git a/lib/services/resourceManagement/lib/feature/models/operation.js b/lib/services/resourceManagement/lib/feature/models/operation.js new file mode 100644 index 0000000000..8d732e8dcb --- /dev/null +++ b/lib/services/resourceManagement/lib/feature/models/operation.js @@ -0,0 +1,66 @@ +/* + * 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'; + +/** + * Microsoft.Features operation + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Features + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/resourceManagement/lib/feature/models/operationDisplay.js b/lib/services/resourceManagement/lib/feature/models/operationDisplay.js new file mode 100644 index 0000000000..f3df1d54e7 --- /dev/null +++ b/lib/services/resourceManagement/lib/feature/models/operationDisplay.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'; + +/** + * The object that represents the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Service provider: Microsoft.Features + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/resourceManagement/lib/feature/models/operationListResult.js b/lib/services/resourceManagement/lib/feature/models/operationListResult.js new file mode 100644 index 0000000000..b6e2492b26 --- /dev/null +++ b/lib/services/resourceManagement/lib/feature/models/operationListResult.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'; + +/** + * Result of the request to list Microsoft.Features operations. It contains a + * list of operations and a URL link to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/resourceManagement/lib/link/managementLinkClient.d.ts b/lib/services/resourceManagement/lib/link/managementLinkClient.d.ts index dfea8e2d1e..1938730369 100644 --- a/lib/services/resourceManagement/lib/link/managementLinkClient.d.ts +++ b/lib/services/resourceManagement/lib/link/managementLinkClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class ManagementLinkClient extends AzureServiceClient { +export default class ManagementLinkClient extends AzureServiceClient { /** * Initializes a new instance of the ManagementLinkClient class. * @constructor @@ -33,11 +34,11 @@ declare class ManagementLinkClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -55,7 +56,8 @@ declare class ManagementLinkClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + operations: operations.Operations; resourceLinks: operations.ResourceLinks; } -export = ManagementLinkClient; +export { ManagementLinkClient, models as ManagementLinkModels }; diff --git a/lib/services/resourceManagement/lib/link/managementLinkClient.js b/lib/services/resourceManagement/lib/link/managementLinkClient.js index bdee35c04b..80f30eaecf 100644 --- a/lib/services/resourceManagement/lib/link/managementLinkClient.js +++ b/lib/services/resourceManagement/lib/link/managementLinkClient.js @@ -34,9 +34,9 @@ class ManagementLinkClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -72,6 +72,7 @@ class ManagementLinkClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.operations = new operations.Operations(this); this.resourceLinks = new operations.ResourceLinks(this); this.models = models; msRest.addSerializationMixin(this); @@ -80,3 +81,6 @@ class ManagementLinkClient extends ServiceClient { } module.exports = ManagementLinkClient; +module.exports['default'] = ManagementLinkClient; +module.exports.ManagementLinkClient = ManagementLinkClient; +module.exports.ManagementLinkModels = models; diff --git a/lib/services/resourceManagement/lib/link/models/index.d.ts b/lib/services/resourceManagement/lib/link/models/index.d.ts index 0a50f5cbd7..74a80a8f1f 100644 --- a/lib/services/resourceManagement/lib/link/models/index.d.ts +++ b/lib/services/resourceManagement/lib/link/models/index.d.ts @@ -54,6 +54,7 @@ export interface ResourceLinkProperties { * * @member {string} [id] The fully qualified ID of the resource link. * @member {string} [name] The name of the resource link. + * @member {object} [type] The resource link object. * @member {object} [properties] Properties for resource link. * @member {string} [properties.sourceId] The fully qualified ID of the source * resource in the link. @@ -61,12 +62,66 @@ export interface ResourceLinkProperties { * resource in the link. * @member {string} [properties.notes] Notes about the resource link. */ -export interface ResourceLink { +export interface ResourceLink extends BaseResource { readonly id?: string; readonly name?: string; + readonly type?: any; properties?: ResourceLinkProperties; } +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * The object that represents the operation. + * + * @member {string} [provider] Service provider: Microsoft.Resources + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + * @member {string} [description] Description of the operation. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Microsoft.Resources operation + * + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Resources + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + * @member {string} [display.description] Description of the operation. + */ +export interface Operation { + name?: string; + display?: OperationDisplay; +} + + +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor + * Result of the request to list Microsoft.Resources operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface OperationListResult extends Array { + nextLink?: string; +} /** * @class diff --git a/lib/services/resourceManagement/lib/link/models/index.js b/lib/services/resourceManagement/lib/link/models/index.js index c0b056c8cd..dd8fa9425c 100644 --- a/lib/services/resourceManagement/lib/link/models/index.js +++ b/lib/services/resourceManagement/lib/link/models/index.js @@ -21,4 +21,7 @@ exports.CloudError = msRestAzure.CloudError; exports.ResourceLinkFilter = require('./resourceLinkFilter'); exports.ResourceLinkProperties = require('./resourceLinkProperties'); exports.ResourceLink = require('./resourceLink'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.OperationListResult = require('./operationListResult'); exports.ResourceLinkResult = require('./resourceLinkResult'); diff --git a/lib/services/resourceManagement/lib/link/models/operation.js b/lib/services/resourceManagement/lib/link/models/operation.js new file mode 100644 index 0000000000..72379472eb --- /dev/null +++ b/lib/services/resourceManagement/lib/link/models/operation.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Microsoft.Resources operation + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Resources + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + * @member {string} [display.description] Description of the operation. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/resourceManagement/lib/link/models/operationDisplay.js b/lib/services/resourceManagement/lib/link/models/operationDisplay.js new file mode 100644 index 0000000000..43cca64606 --- /dev/null +++ b/lib/services/resourceManagement/lib/link/models/operationDisplay.js @@ -0,0 +1,77 @@ +/* + * 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 object that represents the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Service provider: Microsoft.Resources + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + * @member {string} [description] Description of the operation. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/resourceManagement/lib/link/models/operationListResult.js b/lib/services/resourceManagement/lib/link/models/operationListResult.js new file mode 100644 index 0000000000..ea6f61a74a --- /dev/null +++ b/lib/services/resourceManagement/lib/link/models/operationListResult.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'; + +/** + * Result of the request to list Microsoft.Resources operations. It contains a + * list of operations and a URL link to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/resourceManagement/lib/link/models/resourceLink.js b/lib/services/resourceManagement/lib/link/models/resourceLink.js index 0b096a02d9..b18b5c4b4a 100644 --- a/lib/services/resourceManagement/lib/link/models/resourceLink.js +++ b/lib/services/resourceManagement/lib/link/models/resourceLink.js @@ -15,12 +15,14 @@ const models = require('./index'); /** * The resource link. * + * @extends models['BaseResource'] */ -class ResourceLink { +class ResourceLink extends models['BaseResource'] { /** * Create a ResourceLink. * @member {string} [id] The fully qualified ID of the resource link. * @member {string} [name] The name of the resource link. + * @member {object} [type] The resource link object. * @member {object} [properties] Properties for resource link. * @member {string} [properties.sourceId] The fully qualified ID of the * source resource in the link. @@ -29,6 +31,7 @@ class ResourceLink { * @member {string} [properties.notes] Notes about the resource link. */ constructor() { + super(); } /** @@ -61,6 +64,14 @@ class ResourceLink { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'Object' + } + }, properties: { required: false, serializedName: 'properties', diff --git a/lib/services/resourceManagement/lib/link/operations/index.d.ts b/lib/services/resourceManagement/lib/link/operations/index.d.ts index 88f7ebc5ed..fcdb5e1600 100644 --- a/lib/services/resourceManagement/lib/link/operations/index.d.ts +++ b/lib/services/resourceManagement/lib/link/operations/index.d.ts @@ -12,6 +12,123 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ManagementLinkClient. + */ +export interface Operations { + + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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; + + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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 * ResourceLinks diff --git a/lib/services/resourceManagement/lib/link/operations/index.js b/lib/services/resourceManagement/lib/link/operations/index.js index 83cd08a2c0..f0e717103b 100644 --- a/lib/services/resourceManagement/lib/link/operations/index.js +++ b/lib/services/resourceManagement/lib/link/operations/index.js @@ -14,4 +14,5 @@ 'use strict'; +exports.Operations = require('./operations'); exports.ResourceLinks = require('./resourceLinks'); diff --git a/lib/services/resourceManagement/lib/link/operations/operations.js b/lib/services/resourceManagement/lib/link/operations/operations.js new file mode 100644 index 0000000000..2a68335162 --- /dev/null +++ b/lib/services/resourceManagement/lib/link/operations/operations.js @@ -0,0 +1,449 @@ +/* + * 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; + +/** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {object} [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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.Resources/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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Operations. */ +class Operations { + /** + * Create a Operations. + * @param {ManagementLinkClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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); + } + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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 = Operations; diff --git a/lib/services/resourceManagement/lib/lock/managementLockClient.d.ts b/lib/services/resourceManagement/lib/lock/managementLockClient.d.ts index 75cc8b5e0f..615662a95c 100644 --- a/lib/services/resourceManagement/lib/lock/managementLockClient.d.ts +++ b/lib/services/resourceManagement/lib/lock/managementLockClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class ManagementLockClient extends AzureServiceClient { +export default class ManagementLockClient extends AzureServiceClient { /** * Initializes a new instance of the ManagementLockClient class. * @constructor @@ -33,11 +34,11 @@ declare class ManagementLockClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -55,7 +56,8 @@ declare class ManagementLockClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + authorizationOperations: operations.AuthorizationOperations; managementLocks: operations.ManagementLocks; } -export = ManagementLockClient; +export { ManagementLockClient, models as ManagementLockModels }; diff --git a/lib/services/resourceManagement/lib/lock/managementLockClient.js b/lib/services/resourceManagement/lib/lock/managementLockClient.js index 612b09c0e1..c96cd43053 100644 --- a/lib/services/resourceManagement/lib/lock/managementLockClient.js +++ b/lib/services/resourceManagement/lib/lock/managementLockClient.js @@ -34,9 +34,9 @@ class ManagementLockClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -72,6 +72,7 @@ class ManagementLockClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.authorizationOperations = new operations.AuthorizationOperations(this); this.managementLocks = new operations.ManagementLocks(this); this.models = models; msRest.addSerializationMixin(this); @@ -80,3 +81,6 @@ class ManagementLockClient extends ServiceClient { } module.exports = ManagementLockClient; +module.exports['default'] = ManagementLockClient; +module.exports.ManagementLockClient = ManagementLockClient; +module.exports.ManagementLockModels = models; diff --git a/lib/services/resourceManagement/lib/lock/models/index.d.ts b/lib/services/resourceManagement/lib/lock/models/index.d.ts index 8938e4cc5e..a09c25ba64 100644 --- a/lib/services/resourceManagement/lib/lock/models/index.d.ts +++ b/lib/services/resourceManagement/lib/lock/models/index.d.ts @@ -53,10 +53,61 @@ export interface ManagementLockObject extends BaseResource { owners?: ManagementLockOwner[]; readonly id?: string; readonly type?: string; + readonly name?: string; +} + +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * The object that represents the operation. + * + * @member {string} [provider] Service provider: Microsoft.Authorization + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Microsoft.Authorization operation + * + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: + * Microsoft.Authorization + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + */ +export interface Operation { name?: string; + display?: OperationDisplay; } +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor + * Result of the request to list Microsoft.Authorization operations. It + * contains a list of operations and a URL link to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface OperationListResult extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the ManagementLockListResult class. diff --git a/lib/services/resourceManagement/lib/lock/models/index.js b/lib/services/resourceManagement/lib/lock/models/index.js index 7a9a21ebce..0dc8355239 100644 --- a/lib/services/resourceManagement/lib/lock/models/index.js +++ b/lib/services/resourceManagement/lib/lock/models/index.js @@ -20,4 +20,7 @@ exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.ManagementLockOwner = require('./managementLockOwner'); exports.ManagementLockObject = require('./managementLockObject'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.OperationListResult = require('./operationListResult'); exports.ManagementLockListResult = require('./managementLockListResult'); diff --git a/lib/services/resourceManagement/lib/lock/models/managementLockObject.js b/lib/services/resourceManagement/lib/lock/models/managementLockObject.js index c0a0373ce2..71c73f330c 100644 --- a/lib/services/resourceManagement/lib/lock/models/managementLockObject.js +++ b/lib/services/resourceManagement/lib/lock/models/managementLockObject.js @@ -98,6 +98,7 @@ class ManagementLockObject extends models['BaseResource'] { }, name: { required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' diff --git a/lib/services/resourceManagement/lib/lock/models/operation.js b/lib/services/resourceManagement/lib/lock/models/operation.js new file mode 100644 index 0000000000..540fa50c33 --- /dev/null +++ b/lib/services/resourceManagement/lib/lock/models/operation.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Microsoft.Authorization operation + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: + * Microsoft.Authorization + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/resourceManagement/lib/lock/models/operationDisplay.js b/lib/services/resourceManagement/lib/lock/models/operationDisplay.js new file mode 100644 index 0000000000..fca3756e0f --- /dev/null +++ b/lib/services/resourceManagement/lib/lock/models/operationDisplay.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'; + +/** + * The object that represents the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Service provider: Microsoft.Authorization + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/resourceManagement/lib/lock/models/operationListResult.js b/lib/services/resourceManagement/lib/lock/models/operationListResult.js new file mode 100644 index 0000000000..00867bc720 --- /dev/null +++ b/lib/services/resourceManagement/lib/lock/models/operationListResult.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'; + +/** + * Result of the request to list Microsoft.Authorization operations. It + * contains a list of operations and a URL link to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/resourceManagement/lib/lock/operations/authorizationOperations.js b/lib/services/resourceManagement/lib/lock/operations/authorizationOperations.js new file mode 100644 index 0000000000..23ede00008 --- /dev/null +++ b/lib/services/resourceManagement/lib/lock/operations/authorizationOperations.js @@ -0,0 +1,449 @@ +/* + * 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; + +/** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {object} [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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.Authorization/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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 AuthorizationOperations. */ +class AuthorizationOperations { + /** + * Create a AuthorizationOperations. + * @param {ManagementLockClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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); + } + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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 = AuthorizationOperations; diff --git a/lib/services/resourceManagement/lib/lock/operations/index.d.ts b/lib/services/resourceManagement/lib/lock/operations/index.d.ts index 1af94ccced..b95859dd4f 100644 --- a/lib/services/resourceManagement/lib/lock/operations/index.d.ts +++ b/lib/services/resourceManagement/lib/lock/operations/index.d.ts @@ -12,6 +12,123 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * AuthorizationOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ManagementLockClient. + */ +export interface AuthorizationOperations { + + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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; + + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param {string} nextPageLink The NextLink from the 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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 * ManagementLocks @@ -50,8 +167,6 @@ export interface ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -94,8 +209,6 @@ export interface ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -283,8 +396,6 @@ export interface ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -324,8 +435,6 @@ export interface ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -516,8 +625,6 @@ export interface ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -572,8 +679,6 @@ export interface ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -806,8 +911,6 @@ export interface ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -848,8 +951,6 @@ export interface ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/resourceManagement/lib/lock/operations/index.js b/lib/services/resourceManagement/lib/lock/operations/index.js index 3a141311da..69652b1887 100644 --- a/lib/services/resourceManagement/lib/lock/operations/index.js +++ b/lib/services/resourceManagement/lib/lock/operations/index.js @@ -14,4 +14,5 @@ 'use strict'; +exports.AuthorizationOperations = require('./authorizationOperations'); exports.ManagementLocks = require('./managementLocks'); diff --git a/lib/services/resourceManagement/lib/lock/operations/managementLocks.js b/lib/services/resourceManagement/lib/lock/operations/managementLocks.js index 70db64839a..4060c8d4d5 100644 --- a/lib/services/resourceManagement/lib/lock/operations/managementLocks.js +++ b/lib/services/resourceManagement/lib/lock/operations/managementLocks.js @@ -43,8 +43,6 @@ const WebResource = msRest.WebResource; * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -563,8 +561,6 @@ function _getAtResourceGroupLevel(resourceGroupName, lockName, options, callback * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1038,8 +1034,6 @@ function _getByScope(scope, lockName, options, callback) { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1629,8 +1623,6 @@ function _getAtResourceLevel(resourceGroupName, resourceProviderNamespace, paren * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3001,8 +2993,6 @@ class ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3057,8 +3047,6 @@ class ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3315,8 +3303,6 @@ class ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3368,8 +3354,6 @@ class ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3629,8 +3613,6 @@ class ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3697,8 +3679,6 @@ class ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4000,8 +3980,6 @@ class ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4054,8 +4032,6 @@ class ManagementLocks { * * @param {array} [parameters.owners] The owners of the lock. * - * @param {string} [parameters.name] The name of the lock. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/resourceManagement/lib/managedApplicationClient.d.ts b/lib/services/resourceManagement/lib/managedApplicationClient.d.ts new file mode 100644 index 0000000000..e9dd974cf8 --- /dev/null +++ b/lib/services/resourceManagement/lib/managedApplicationClient.d.ts @@ -0,0 +1,171 @@ +/* + * 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 ManagedApplicationClient extends AzureServiceClient { + /** + * Initializes a new instance of the ManagedApplicationClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - The ID of the target subscription. + * + * @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 + appliances: operations.Appliances; + applianceDefinitions: operations.ApplianceDefinitions; + + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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; + + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {string} nextPageLink The NextLink from the 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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; +} + +export { ManagedApplicationClient, models as ManagedApplicationModels }; diff --git a/lib/services/resourceManagement/lib/managedApplicationClient.js b/lib/services/resourceManagement/lib/managedApplicationClient.js new file mode 100644 index 0000000000..80c3ba8a78 --- /dev/null +++ b/lib/services/resourceManagement/lib/managedApplicationClient.js @@ -0,0 +1,507 @@ +/* + * 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'); + + +/** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {object} [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; + 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.Solutions/operations'; + 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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 OperationListResult} for more information. + * + * {object} [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; + 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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ManagedApplicationClient. */ +class ManagedApplicationClient extends ServiceClient { + /** + * Create a ManagedApplicationClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - The ID of the target subscription. + * @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 = '2016-09-01-preview'; + 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.appliances = new operations.Appliances(this); + this.applianceDefinitions = new operations.ApplianceDefinitions(this); + this.models = models; + this._listOperations = _listOperations; + this._listOperationsNext = _listOperationsNext; + msRest.addSerializationMixin(this); + } + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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; + 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); + } + } + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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; + 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 = ManagedApplicationClient; +module.exports['default'] = ManagedApplicationClient; +module.exports.ManagedApplicationClient = ManagedApplicationClient; +module.exports.ManagedApplicationModels = models; diff --git a/lib/services/resourceManagement/lib/models/appliance.js b/lib/services/resourceManagement/lib/models/appliance.js new file mode 100644 index 0000000000..bfd28704a6 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/appliance.js @@ -0,0 +1,199 @@ +/* + * 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'); + +/** + * Information about appliance. + * + * @extends models['GenericResource'] + */ +class Appliance extends models['GenericResource'] { + /** + * Create a Appliance. + * @member {string} managedResourceGroupId The managed resource group Id. + * @member {string} [applianceDefinitionId] The fully qualified path of + * appliance definition Id. + * @member {object} [parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * @member {object} [outputs] Name and value pairs that define the appliance + * outputs. + * @member {string} [provisioningState] The appliance provisioning state. + * Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', + * 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', + * 'Updating' + * @member {string} [uiDefinitionUri] The blob URI where the UI definition + * file is located. + * @member {object} [plan] The plan information. + * @member {string} [plan.name] The plan name. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] The product code. + * @member {string} [plan.promotionCode] The promotion code. + * @member {string} [plan.version] The plan's version. + * @member {string} [kind] The kind of the appliance. Allowed values are + * MarketPlace and ServiceCatalog. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Appliance + * + * @returns {object} metadata of Appliance + * + */ + mapper() { + return { + required: false, + serializedName: 'Appliance', + type: { + name: 'Composite', + className: 'Appliance', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managedBy: { + required: false, + serializedName: 'managedBy', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'Identity' + } + }, + managedResourceGroupId: { + required: true, + serializedName: 'properties.managedResourceGroupId', + type: { + name: 'String' + } + }, + applianceDefinitionId: { + required: false, + serializedName: 'properties.applianceDefinitionId', + type: { + name: 'String' + } + }, + parameters: { + required: false, + serializedName: 'properties.parameters', + type: { + name: 'Object' + } + }, + outputs: { + required: false, + readOnly: true, + serializedName: 'properties.outputs', + type: { + name: 'Object' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + uiDefinitionUri: { + required: false, + serializedName: 'properties.uiDefinitionUri', + type: { + name: 'String' + } + }, + plan: { + required: false, + serializedName: 'plan', + type: { + name: 'Composite', + className: 'Plan' + } + }, + kind: { + required: false, + serializedName: 'kind', + constraints: { + Pattern: '^[-\w\._,\(\)]+$' + }, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Appliance; diff --git a/lib/services/resourceManagement/lib/models/applianceArtifact.js b/lib/services/resourceManagement/lib/models/applianceArtifact.js new file mode 100644 index 0000000000..983a8d5b5d --- /dev/null +++ b/lib/services/resourceManagement/lib/models/applianceArtifact.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Appliance artifact. + * + */ +class ApplianceArtifact { + /** + * Create a ApplianceArtifact. + * @member {string} [name] The appliance artifact name. + * @member {string} [uri] The appliance artifact blob uri. + * @member {string} [type] The the appliance artifact type. Possible values + * include: 'Template', 'Custom' + */ + constructor() { + } + + /** + * Defines the metadata of ApplianceArtifact + * + * @returns {object} metadata of ApplianceArtifact + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplianceArtifact', + type: { + name: 'Composite', + className: 'ApplianceArtifact', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + uri: { + required: false, + serializedName: 'uri', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'Template', 'Custom' ] + } + } + } + } + }; + } +} + +module.exports = ApplianceArtifact; diff --git a/lib/services/resourceManagement/lib/models/applianceDefinition.js b/lib/services/resourceManagement/lib/models/applianceDefinition.js new file mode 100644 index 0000000000..e91cd4044f --- /dev/null +++ b/lib/services/resourceManagement/lib/models/applianceDefinition.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'); + +/** + * Information about appliance definition. + * + * @extends models['GenericResource'] + */ +class ApplianceDefinition extends models['GenericResource'] { + /** + * Create a ApplianceDefinition. + * @member {string} lockLevel The appliance lock level. Possible values + * include: 'CanNotDelete', 'ReadOnly', 'None' + * @member {string} [displayName] The appliance definition display name. + * @member {array} authorizations The appliance provider authorizations. + * @member {array} [artifacts] The collection of appliance artifacts. The + * portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * @member {string} [description] The appliance definition description. + * @member {string} packageFileUri The appliance definition package file Uri. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplianceDefinition + * + * @returns {object} metadata of ApplianceDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplianceDefinition', + type: { + name: 'Composite', + className: 'ApplianceDefinition', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managedBy: { + required: false, + serializedName: 'managedBy', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'Identity' + } + }, + lockLevel: { + required: true, + serializedName: 'properties.lockLevel', + type: { + name: 'Enum', + allowedValues: [ 'CanNotDelete', 'ReadOnly', 'None' ] + } + }, + displayName: { + required: false, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + }, + authorizations: { + required: true, + serializedName: 'properties.authorizations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplianceProviderAuthorizationElementType', + type: { + name: 'Composite', + className: 'ApplianceProviderAuthorization' + } + } + } + }, + artifacts: { + required: false, + serializedName: 'properties.artifacts', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplianceArtifactElementType', + type: { + name: 'Composite', + className: 'ApplianceArtifact' + } + } + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + packageFileUri: { + required: true, + serializedName: 'properties.packageFileUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplianceDefinition; diff --git a/lib/services/resourceManagement/lib/models/applianceDefinitionListResult.js b/lib/services/resourceManagement/lib/models/applianceDefinitionListResult.js new file mode 100644 index 0000000000..ff9634d9af --- /dev/null +++ b/lib/services/resourceManagement/lib/models/applianceDefinitionListResult.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'; + +/** + * List of appliance definitions. + */ +class ApplianceDefinitionListResult extends Array { + /** + * Create a ApplianceDefinitionListResult. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplianceDefinitionListResult + * + * @returns {object} metadata of ApplianceDefinitionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplianceDefinitionListResult', + type: { + name: 'Composite', + className: 'ApplianceDefinitionListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplianceDefinitionElementType', + type: { + name: 'Composite', + className: 'ApplianceDefinition' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplianceDefinitionListResult; diff --git a/lib/services/resourceManagement/lib/models/applianceListResult.js b/lib/services/resourceManagement/lib/models/applianceListResult.js new file mode 100644 index 0000000000..4fe21fd9ac --- /dev/null +++ b/lib/services/resourceManagement/lib/models/applianceListResult.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'; + +/** + * List of appliances. + */ +class ApplianceListResult extends Array { + /** + * Create a ApplianceListResult. + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplianceListResult + * + * @returns {object} metadata of ApplianceListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplianceListResult', + type: { + name: 'Composite', + className: 'ApplianceListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplianceElementType', + type: { + name: 'Composite', + className: 'Appliance' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplianceListResult; diff --git a/lib/services/resourceManagement/lib/models/appliancePatchable.js b/lib/services/resourceManagement/lib/models/appliancePatchable.js new file mode 100644 index 0000000000..8958405901 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/appliancePatchable.js @@ -0,0 +1,199 @@ +/* + * 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'); + +/** + * Information about appliance. + * + * @extends models['GenericResource'] + */ +class AppliancePatchable extends models['GenericResource'] { + /** + * Create a AppliancePatchable. + * @member {string} [managedResourceGroupId] The managed resource group Id. + * @member {string} [applianceDefinitionId] The fully qualified path of + * appliance definition Id. + * @member {object} [parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * @member {object} [outputs] Name and value pairs that define the appliance + * outputs. + * @member {string} [provisioningState] The appliance provisioning state. + * Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', + * 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', + * 'Updating' + * @member {string} [uiDefinitionUri] The blob URI where the UI definition + * file is located. + * @member {object} [plan] The plan information. + * @member {string} [plan.name] The plan name. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] The product code. + * @member {string} [plan.promotionCode] The promotion code. + * @member {string} [plan.version] The plan's version. + * @member {string} [kind] The kind of the appliance. Allowed values are + * MarketPlace and ServiceCatalog. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppliancePatchable + * + * @returns {object} metadata of AppliancePatchable + * + */ + mapper() { + return { + required: false, + serializedName: 'AppliancePatchable', + type: { + name: 'Composite', + className: 'AppliancePatchable', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managedBy: { + required: false, + serializedName: 'managedBy', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'Identity' + } + }, + managedResourceGroupId: { + required: false, + serializedName: 'properties.managedResourceGroupId', + type: { + name: 'String' + } + }, + applianceDefinitionId: { + required: false, + serializedName: 'properties.applianceDefinitionId', + type: { + name: 'String' + } + }, + parameters: { + required: false, + serializedName: 'properties.parameters', + type: { + name: 'Object' + } + }, + outputs: { + required: false, + readOnly: true, + serializedName: 'properties.outputs', + type: { + name: 'Object' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + uiDefinitionUri: { + required: false, + serializedName: 'properties.uiDefinitionUri', + type: { + name: 'String' + } + }, + plan: { + required: false, + serializedName: 'plan', + type: { + name: 'Composite', + className: 'PlanPatchable' + } + }, + kind: { + required: false, + serializedName: 'kind', + constraints: { + Pattern: '^[-\w\._,\(\)]+$' + }, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppliancePatchable; diff --git a/lib/services/resourceManagement/lib/models/applianceProviderAuthorization.js b/lib/services/resourceManagement/lib/models/applianceProviderAuthorization.js new file mode 100644 index 0000000000..aaea0ed206 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/applianceProviderAuthorization.js @@ -0,0 +1,65 @@ +/* + * 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 appliance provider authorization. + * + */ +class ApplianceProviderAuthorization { + /** + * Create a ApplianceProviderAuthorization. + * @member {string} principalId The provider's principal identifier. This is + * the identity that the provider will use to call ARM to manage the + * appliance resources. + * @member {string} roleDefinitionId The provider's role definition + * identifier. This role will define all the permissions that the provider + * must have on the appliance's container resource group. This role + * definition cannot have permission to delete the resource group. + */ + constructor() { + } + + /** + * Defines the metadata of ApplianceProviderAuthorization + * + * @returns {object} metadata of ApplianceProviderAuthorization + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplianceProviderAuthorization', + type: { + name: 'Composite', + className: 'ApplianceProviderAuthorization', + modelProperties: { + principalId: { + required: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + roleDefinitionId: { + required: true, + serializedName: 'roleDefinitionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplianceProviderAuthorization; diff --git a/lib/services/resourceManagement/lib/models/errorResponse.js b/lib/services/resourceManagement/lib/models/errorResponse.js new file mode 100644 index 0000000000..559d320b99 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/errorResponse.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Error reponse indicates ARM appliance is not able to process the incoming + * request. The reason is provided in the error message. + * + */ +class ErrorResponse { + /** + * Create a ErrorResponse. + * @member {string} [httpStatus] Http status code. + * @member {string} [errorCode] Error code. + * @member {string} [errorMessage] Error message indicating why the operation + * failed. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorResponse + * + * @returns {object} metadata of ErrorResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorResponse', + type: { + name: 'Composite', + className: 'ErrorResponse', + modelProperties: { + httpStatus: { + required: false, + serializedName: 'httpStatus', + type: { + name: 'String' + } + }, + errorCode: { + required: false, + serializedName: 'errorCode', + type: { + name: 'String' + } + }, + errorMessage: { + required: false, + serializedName: 'errorMessage', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorResponse; diff --git a/lib/services/resourceManagement/lib/models/genericResource.js b/lib/services/resourceManagement/lib/models/genericResource.js new file mode 100644 index 0000000000..9e265d77fc --- /dev/null +++ b/lib/services/resourceManagement/lib/models/genericResource.js @@ -0,0 +1,131 @@ +/* + * 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'); + +/** + * Resource information. + * + * @extends models['Resource'] + */ +class GenericResource extends models['Resource'] { + /** + * Create a GenericResource. + * @member {string} [managedBy] ID of the resource that manages this + * resource. + * @member {object} [sku] The SKU of the resource. + * @member {string} [sku.name] The SKU name. + * @member {string} [sku.tier] The SKU tier. + * @member {string} [sku.size] The SKU size. + * @member {string} [sku.family] The SKU family. + * @member {string} [sku.model] The SKU model. + * @member {number} [sku.capacity] The SKU capacity. + * @member {object} [identity] The identity of the resource. + * @member {string} [identity.principalId] The principal ID of resource + * identity. + * @member {string} [identity.tenantId] The tenant ID of resource. + * @member {string} [identity.type] The identity type. Possible values + * include: 'SystemAssigned' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GenericResource + * + * @returns {object} metadata of GenericResource + * + */ + mapper() { + return { + required: false, + serializedName: 'GenericResource', + type: { + name: 'Composite', + className: 'GenericResource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managedBy: { + required: false, + serializedName: 'managedBy', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'Identity' + } + } + } + } + }; + } +} + +module.exports = GenericResource; diff --git a/lib/services/resourceManagement/lib/models/identity.js b/lib/services/resourceManagement/lib/models/identity.js new file mode 100644 index 0000000000..14c1fe4686 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/identity.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Identity for the resource. + * + */ +class Identity { + /** + * Create a Identity. + * @member {string} [principalId] The principal ID of resource identity. + * @member {string} [tenantId] The tenant ID of resource. + * @member {string} [type] The identity type. Possible values include: + * 'SystemAssigned' + */ + constructor() { + } + + /** + * Defines the metadata of Identity + * + * @returns {object} metadata of Identity + * + */ + mapper() { + return { + required: false, + serializedName: 'Identity', + type: { + name: 'Composite', + className: 'Identity', + modelProperties: { + principalId: { + required: false, + readOnly: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + tenantId: { + required: false, + readOnly: true, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'SystemAssigned' ] + } + } + } + } + }; + } +} + +module.exports = Identity; diff --git a/lib/services/resourceManagement/lib/models/index.d.ts b/lib/services/resourceManagement/lib/models/index.d.ts new file mode 100644 index 0000000000..fc4c2d41a8 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/index.d.ts @@ -0,0 +1,377 @@ +/* + * 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 Plan class. + * @constructor + * Plan for the appliance. + * + * @member {string} name The plan name. + * @member {string} publisher The publisher ID. + * @member {string} product The product code. + * @member {string} [promotionCode] The promotion code. + * @member {string} version The plan's version. + */ +export interface Plan { + name: string; + publisher: string; + product: string; + promotionCode?: string; + version: string; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * Resource information. + * + * @member {string} [id] Resource ID + * @member {string} [name] Resource name + * @member {string} [type] Resource type + * @member {string} [location] Resource location + * @member {object} [tags] Resource tags + */ +export interface Resource extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; + location?: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the GenericResource class. + * @constructor + * Resource information. + * + * @member {string} [managedBy] ID of the resource that manages this resource. + * @member {object} [sku] The SKU of the resource. + * @member {string} [sku.name] The SKU name. + * @member {string} [sku.tier] The SKU tier. + * @member {string} [sku.size] The SKU size. + * @member {string} [sku.family] The SKU family. + * @member {string} [sku.model] The SKU model. + * @member {number} [sku.capacity] The SKU capacity. + * @member {object} [identity] The identity of the resource. + * @member {string} [identity.principalId] The principal ID of resource + * identity. + * @member {string} [identity.tenantId] The tenant ID of resource. + * @member {string} [identity.type] The identity type. Possible values include: + * 'SystemAssigned' + */ +export interface GenericResource extends Resource { + managedBy?: string; + sku?: Sku; + identity?: Identity; +} + +/** + * @class + * Initializes a new instance of the Appliance class. + * @constructor + * Information about appliance. + * + * @member {string} managedResourceGroupId The managed resource group Id. + * @member {string} [applianceDefinitionId] The fully qualified path of + * appliance definition Id. + * @member {object} [parameters] Name and value pairs that define the appliance + * parameters. It can be a JObject or a well formed JSON string. + * @member {object} [outputs] Name and value pairs that define the appliance + * outputs. + * @member {string} [provisioningState] The appliance provisioning state. + * Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', + * 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', + * 'Updating' + * @member {string} [uiDefinitionUri] The blob URI where the UI definition file + * is located. + * @member {object} [plan] The plan information. + * @member {string} [plan.name] The plan name. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] The product code. + * @member {string} [plan.promotionCode] The promotion code. + * @member {string} [plan.version] The plan's version. + * @member {string} [kind] The kind of the appliance. Allowed values are + * MarketPlace and ServiceCatalog. + */ +export interface Appliance extends GenericResource { + managedResourceGroupId: string; + applianceDefinitionId?: string; + parameters?: any; + readonly outputs?: any; + readonly provisioningState?: string; + uiDefinitionUri?: string; + plan?: Plan; + kind?: string; +} + +/** + * @class + * Initializes a new instance of the PlanPatchable class. + * @constructor + * Plan for the appliance. + * + * @member {string} [name] The plan name. + * @member {string} [publisher] The publisher ID. + * @member {string} [product] The product code. + * @member {string} [promotionCode] The promotion code. + * @member {string} [version] The plan's version. + */ +export interface PlanPatchable { + name?: string; + publisher?: string; + product?: string; + promotionCode?: string; + version?: string; +} + +/** + * @class + * Initializes a new instance of the AppliancePatchable class. + * @constructor + * Information about appliance. + * + * @member {string} [managedResourceGroupId] The managed resource group Id. + * @member {string} [applianceDefinitionId] The fully qualified path of + * appliance definition Id. + * @member {object} [parameters] Name and value pairs that define the appliance + * parameters. It can be a JObject or a well formed JSON string. + * @member {object} [outputs] Name and value pairs that define the appliance + * outputs. + * @member {string} [provisioningState] The appliance provisioning state. + * Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', + * 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', + * 'Updating' + * @member {string} [uiDefinitionUri] The blob URI where the UI definition file + * is located. + * @member {object} [plan] The plan information. + * @member {string} [plan.name] The plan name. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] The product code. + * @member {string} [plan.promotionCode] The promotion code. + * @member {string} [plan.version] The plan's version. + * @member {string} [kind] The kind of the appliance. Allowed values are + * MarketPlace and ServiceCatalog. + */ +export interface AppliancePatchable extends GenericResource { + managedResourceGroupId?: string; + applianceDefinitionId?: string; + parameters?: any; + readonly outputs?: any; + readonly provisioningState?: string; + uiDefinitionUri?: string; + plan?: PlanPatchable; + kind?: string; +} + +/** + * @class + * Initializes a new instance of the ApplianceProviderAuthorization class. + * @constructor + * The appliance provider authorization. + * + * @member {string} principalId The provider's principal identifier. This is + * the identity that the provider will use to call ARM to manage the appliance + * resources. + * @member {string} roleDefinitionId The provider's role definition identifier. + * This role will define all the permissions that the provider must have on the + * appliance's container resource group. This role definition cannot have + * permission to delete the resource group. + */ +export interface ApplianceProviderAuthorization { + principalId: string; + roleDefinitionId: string; +} + +/** + * @class + * Initializes a new instance of the ApplianceArtifact class. + * @constructor + * Appliance artifact. + * + * @member {string} [name] The appliance artifact name. + * @member {string} [uri] The appliance artifact blob uri. + * @member {string} [type] The the appliance artifact type. Possible values + * include: 'Template', 'Custom' + */ +export interface ApplianceArtifact { + name?: string; + uri?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ApplianceDefinition class. + * @constructor + * Information about appliance definition. + * + * @member {string} lockLevel The appliance lock level. Possible values + * include: 'CanNotDelete', 'ReadOnly', 'None' + * @member {string} [displayName] The appliance definition display name. + * @member {array} authorizations The appliance provider authorizations. + * @member {array} [artifacts] The collection of appliance artifacts. The + * portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * @member {string} [description] The appliance definition description. + * @member {string} packageFileUri The appliance definition package file Uri. + */ +export interface ApplianceDefinition extends GenericResource { + lockLevel: string; + displayName?: string; + authorizations: ApplianceProviderAuthorization[]; + artifacts?: ApplianceArtifact[]; + description?: string; + packageFileUri: string; +} + +/** + * @class + * Initializes a new instance of the Sku class. + * @constructor + * SKU for the resource. + * + * @member {string} name The SKU name. + * @member {string} [tier] The SKU tier. + * @member {string} [size] The SKU size. + * @member {string} [family] The SKU family. + * @member {string} [model] The SKU model. + * @member {number} [capacity] The SKU capacity. + */ +export interface Sku { + name: string; + tier?: string; + size?: string; + family?: string; + model?: string; + capacity?: number; +} + +/** + * @class + * Initializes a new instance of the Identity class. + * @constructor + * Identity for the resource. + * + * @member {string} [principalId] The principal ID of resource identity. + * @member {string} [tenantId] The tenant ID of resource. + * @member {string} [type] The identity type. Possible values include: + * 'SystemAssigned' + */ +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ErrorResponse class. + * @constructor + * Error reponse indicates ARM appliance is not able to process the incoming + * request. The reason is provided in the error message. + * + * @member {string} [httpStatus] Http status code. + * @member {string} [errorCode] Error code. + * @member {string} [errorMessage] Error message indicating why the operation + * failed. + */ +export interface ErrorResponse { + httpStatus?: string; + errorCode?: string; + errorMessage?: string; +} + +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * The object that represents the operation. + * + * @member {string} [provider] Service provider: Microsoft.Solutions + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Microsoft.Solutions operation + * + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Solutions + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + */ +export interface Operation { + name?: string; + display?: OperationDisplay; +} + + +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor + * Result of the request to list Microsoft.Solutions operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface OperationListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ApplianceListResult class. + * @constructor + * List of appliances. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ +export interface ApplianceListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ApplianceDefinitionListResult class. + * @constructor + * List of appliance definitions. + * + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ +export interface ApplianceDefinitionListResult extends Array { + nextLink?: string; +} diff --git a/lib/services/resourceManagement/lib/models/index.js b/lib/services/resourceManagement/lib/models/index.js new file mode 100644 index 0000000000..d67f4c35b6 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/index.js @@ -0,0 +1,37 @@ +/* + * 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.Plan = require('./plan'); +exports.Resource = require('./resource'); +exports.GenericResource = require('./genericResource'); +exports.Appliance = require('./appliance'); +exports.PlanPatchable = require('./planPatchable'); +exports.AppliancePatchable = require('./appliancePatchable'); +exports.ApplianceProviderAuthorization = require('./applianceProviderAuthorization'); +exports.ApplianceArtifact = require('./applianceArtifact'); +exports.ApplianceDefinition = require('./applianceDefinition'); +exports.Sku = require('./sku'); +exports.Identity = require('./identity'); +exports.ErrorResponse = require('./errorResponse'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.OperationListResult = require('./operationListResult'); +exports.ApplianceListResult = require('./applianceListResult'); +exports.ApplianceDefinitionListResult = require('./applianceDefinitionListResult'); diff --git a/lib/services/resourceManagement/lib/models/operation.js b/lib/services/resourceManagement/lib/models/operation.js new file mode 100644 index 0000000000..dabb95d5df --- /dev/null +++ b/lib/services/resourceManagement/lib/models/operation.js @@ -0,0 +1,66 @@ +/* + * 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'; + +/** + * Microsoft.Solutions operation + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Solutions + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/resourceManagement/lib/models/operationDisplay.js b/lib/services/resourceManagement/lib/models/operationDisplay.js new file mode 100644 index 0000000000..d0ed28a904 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/operationDisplay.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'; + +/** + * The object that represents the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Service provider: Microsoft.Solutions + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/resourceManagement/lib/models/operationListResult.js b/lib/services/resourceManagement/lib/models/operationListResult.js new file mode 100644 index 0000000000..27e8728e1a --- /dev/null +++ b/lib/services/resourceManagement/lib/models/operationListResult.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'; + +/** + * Result of the request to list Microsoft.Solutions operations. It contains a + * list of operations and a URL link to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/resourceManagement/lib/models/plan.js b/lib/services/resourceManagement/lib/models/plan.js new file mode 100644 index 0000000000..fb6fb37d00 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/plan.js @@ -0,0 +1,84 @@ +/* + * 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'; + +/** + * Plan for the appliance. + * + */ +class Plan { + /** + * Create a Plan. + * @member {string} name The plan name. + * @member {string} publisher The publisher ID. + * @member {string} product The product code. + * @member {string} [promotionCode] The promotion code. + * @member {string} version The plan's version. + */ + constructor() { + } + + /** + * Defines the metadata of Plan + * + * @returns {object} metadata of Plan + * + */ + mapper() { + return { + required: false, + serializedName: 'Plan', + type: { + name: 'Composite', + className: 'Plan', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + publisher: { + required: true, + serializedName: 'publisher', + type: { + name: 'String' + } + }, + product: { + required: true, + serializedName: 'product', + type: { + name: 'String' + } + }, + promotionCode: { + required: false, + serializedName: 'promotionCode', + type: { + name: 'String' + } + }, + version: { + required: true, + serializedName: 'version', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Plan; diff --git a/lib/services/resourceManagement/lib/models/planPatchable.js b/lib/services/resourceManagement/lib/models/planPatchable.js new file mode 100644 index 0000000000..b54289ce51 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/planPatchable.js @@ -0,0 +1,84 @@ +/* + * 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'; + +/** + * Plan for the appliance. + * + */ +class PlanPatchable { + /** + * Create a PlanPatchable. + * @member {string} [name] The plan name. + * @member {string} [publisher] The publisher ID. + * @member {string} [product] The product code. + * @member {string} [promotionCode] The promotion code. + * @member {string} [version] The plan's version. + */ + constructor() { + } + + /** + * Defines the metadata of PlanPatchable + * + * @returns {object} metadata of PlanPatchable + * + */ + mapper() { + return { + required: false, + serializedName: 'PlanPatchable', + type: { + name: 'Composite', + className: 'PlanPatchable', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + publisher: { + required: false, + serializedName: 'publisher', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'product', + type: { + name: 'String' + } + }, + promotionCode: { + required: false, + serializedName: 'promotionCode', + type: { + name: 'String' + } + }, + version: { + required: false, + serializedName: 'version', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PlanPatchable; diff --git a/lib/services/resourceManagement/lib/models/resource.js b/lib/services/resourceManagement/lib/models/resource.js new file mode 100644 index 0000000000..aa4fa609c4 --- /dev/null +++ b/lib/services/resourceManagement/lib/models/resource.js @@ -0,0 +1,98 @@ +/* + * 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'); + +/** + * Resource information. + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @member {string} [id] Resource ID + * @member {string} [name] Resource name + * @member {string} [type] Resource type + * @member {string} [location] Resource location + * @member {object} [tags] Resource tags + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/resourceManagement/lib/models/sku.js b/lib/services/resourceManagement/lib/models/sku.js new file mode 100644 index 0000000000..601a2e365e --- /dev/null +++ b/lib/services/resourceManagement/lib/models/sku.js @@ -0,0 +1,92 @@ +/* + * 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'; + +/** + * SKU for the resource. + * + */ +class Sku { + /** + * Create a Sku. + * @member {string} name The SKU name. + * @member {string} [tier] The SKU tier. + * @member {string} [size] The SKU size. + * @member {string} [family] The SKU family. + * @member {string} [model] The SKU model. + * @member {number} [capacity] The SKU capacity. + */ + constructor() { + } + + /** + * Defines the metadata of Sku + * + * @returns {object} metadata of Sku + * + */ + mapper() { + return { + required: false, + serializedName: 'Sku', + type: { + name: 'Composite', + className: 'Sku', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + size: { + required: false, + serializedName: 'size', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + }, + model: { + required: false, + serializedName: 'model', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = Sku; diff --git a/lib/services/resourceManagement/lib/operations/applianceDefinitions.js b/lib/services/resourceManagement/lib/operations/applianceDefinitions.js new file mode 100644 index 0000000000..449eb73f64 --- /dev/null +++ b/lib/services/resourceManagement/lib/operations/applianceDefinitions.js @@ -0,0 +1,3163 @@ +/* + * 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; + +/** + * Gets the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {object} [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, applianceDefinitionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (applianceDefinitionName === null || applianceDefinitionName === undefined || typeof applianceDefinitionName.valueOf() !== 'string') { + throw new Error('applianceDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (applianceDefinitionName !== null && applianceDefinitionName !== undefined) { + if (applianceDefinitionName.length > 64) + { + throw new Error('"applianceDefinitionName" should satisfy the constraint - "MaxLength": 64'); + } + if (applianceDefinitionName.length < 3) + { + throw new Error('"applianceDefinitionName" should satisfy the constraint - "MinLength": 3'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applianceDefinitionName}', encodeURIComponent(applianceDefinitionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, applianceDefinitionName, options, callback) { + /* jshint 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, applianceDefinitionName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {object} [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, applianceDefinitionName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, applianceDefinitionName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists the appliance definitions in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinitionListResult} for more + * information. + * + * {object} [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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions'; + 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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 ApplianceDefinition} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getById(applianceDefinitionId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (applianceDefinitionId === null || applianceDefinitionId === undefined || typeof applianceDefinitionId.valueOf() !== 'string') { + throw new Error('applianceDefinitionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{applianceDefinitionId}'; + requestUrl = requestUrl.replace('{applianceDefinitionId}', applianceDefinitionId); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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 _deleteById(applianceDefinitionId, options, callback) { + /* jshint 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.beginDeleteById(applianceDefinitionId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdateById(applianceDefinitionId, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateById(applianceDefinitionId, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, applianceDefinitionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (applianceDefinitionName === null || applianceDefinitionName === undefined || typeof applianceDefinitionName.valueOf() !== 'string') { + throw new Error('applianceDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (applianceDefinitionName !== null && applianceDefinitionName !== undefined) { + if (applianceDefinitionName.length > 64) + { + throw new Error('"applianceDefinitionName" should satisfy the constraint - "MaxLength": 64'); + } + if (applianceDefinitionName.length < 3) + { + throw new Error('"applianceDefinitionName" should satisfy the constraint - "MinLength": 3'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applianceDefinitionName}', encodeURIComponent(applianceDefinitionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {object} [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, applianceDefinitionName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (applianceDefinitionName === null || applianceDefinitionName === undefined || typeof applianceDefinitionName.valueOf() !== 'string') { + throw new Error('applianceDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (applianceDefinitionName !== null && applianceDefinitionName !== undefined) { + if (applianceDefinitionName.length > 64) + { + throw new Error('"applianceDefinitionName" should satisfy the constraint - "MaxLength": 64'); + } + if (applianceDefinitionName.length < 3) + { + throw new Error('"applianceDefinitionName" should satisfy the constraint - "MinLength": 3'); + } + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applianceDefinitionName}', encodeURIComponent(applianceDefinitionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ApplianceDefinition']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['ApplianceDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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 _beginDeleteById(applianceDefinitionId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (applianceDefinitionId === null || applianceDefinitionId === undefined || typeof applianceDefinitionId.valueOf() !== 'string') { + throw new Error('applianceDefinitionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{applianceDefinitionId}'; + requestUrl = requestUrl.replace('{applianceDefinitionId}', applianceDefinitionId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdateById(applianceDefinitionId, 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 (applianceDefinitionId === null || applianceDefinitionId === undefined || typeof applianceDefinitionId.valueOf() !== 'string') { + throw new Error('applianceDefinitionId cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{applianceDefinitionId}'; + requestUrl = requestUrl.replace('{applianceDefinitionId}', applianceDefinitionId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ApplianceDefinition']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceDefinition']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['ApplianceDefinition']().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); + }); +} + +/** + * Lists the appliance definitions 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 ApplianceDefinitionListResult} for more + * information. + * + * {object} [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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 ApplianceDefinitions. */ +class ApplianceDefinitions { + /** + * Create a ApplianceDefinitions. + * @param {ManagedApplicationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._createOrUpdate = _createOrUpdate; + this._listByResourceGroup = _listByResourceGroup; + this._getById = _getById; + this._deleteById = _deleteById; + this._createOrUpdateById = _createOrUpdateById; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteById = _beginDeleteById; + this._beginCreateOrUpdateById = _beginCreateOrUpdateById; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Gets the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceDefinitionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, applianceDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {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, applianceDefinitionName, options, optionalCallback) { + 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, applianceDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, applianceDefinitionName, options, optionalCallback); + } + } + + /** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceDefinitionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, applianceDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, applianceDefinitionName, options, optionalCallback) { + 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, applianceDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, applianceDefinitionName, options, optionalCallback); + } + } + + /** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceDefinitionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, applianceDefinitionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {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, applianceDefinitionName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, applianceDefinitionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, applianceDefinitionName, parameters, options, optionalCallback); + } + } + + /** + * Lists the appliance definitions in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists the appliance definitions in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplianceDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinitionListResult} for more + * information. + * + * {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); + } + } + + /** + * Gets the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + getByIdWithHttpOperationResponse(applianceDefinitionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getById(applianceDefinitionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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 {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getById(applianceDefinitionId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getById(applianceDefinitionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getById(applianceDefinitionId, options, optionalCallback); + } + } + + /** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + deleteByIdWithHttpOperationResponse(applianceDefinitionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteById(applianceDefinitionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + deleteById(applianceDefinitionId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteById(applianceDefinitionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteById(applianceDefinitionId, options, optionalCallback); + } + } + + /** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateByIdWithHttpOperationResponse(applianceDefinitionId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateById(applianceDefinitionId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateById(applianceDefinitionId, 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._createOrUpdateById(applianceDefinitionId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateById(applianceDefinitionId, parameters, options, optionalCallback); + } + } + + /** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceDefinitionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, applianceDefinitionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, applianceDefinitionName, options, optionalCallback) { + 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, applianceDefinitionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, applianceDefinitionName, options, optionalCallback); + } + } + + /** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceDefinitionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, applianceDefinitionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {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, applianceDefinitionName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, applianceDefinitionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, applianceDefinitionName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + beginDeleteByIdWithHttpOperationResponse(applianceDefinitionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteById(applianceDefinitionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + beginDeleteById(applianceDefinitionId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteById(applianceDefinitionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteById(applianceDefinitionId, options, optionalCallback); + } + } + + /** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateByIdWithHttpOperationResponse(applianceDefinitionId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdateById(applianceDefinitionId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdateById(applianceDefinitionId, 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._beginCreateOrUpdateById(applianceDefinitionId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdateById(applianceDefinitionId, parameters, options, optionalCallback); + } + } + + /** + * Lists the appliance definitions 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; + }); + }); + } + + /** + * Lists the appliance definitions 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 {ApplianceDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinitionListResult} for more + * information. + * + * {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 = ApplianceDefinitions; diff --git a/lib/services/resourceManagement/lib/operations/appliances.js b/lib/services/resourceManagement/lib/operations/appliances.js new file mode 100644 index 0000000000..421180eb89 --- /dev/null +++ b/lib/services/resourceManagement/lib/operations/appliances.js @@ -0,0 +1,4508 @@ +/* + * 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; + +/** + * Gets the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [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, applianceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (applianceName === null || applianceName === undefined || typeof applianceName.valueOf() !== 'string') { + throw new Error('applianceName cannot be null or undefined and it must be of type string.'); + } + if (applianceName !== null && applianceName !== undefined) { + if (applianceName.length > 64) + { + throw new Error('"applianceName" should satisfy the constraint - "MaxLength": 64'); + } + if (applianceName.length < 3) + { + throw new Error('"applianceName" should satisfy the constraint - "MinLength": 3'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances/{applianceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applianceName}', encodeURIComponent(applianceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, applianceName, options, callback) { + /* jshint 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, applianceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [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, applianceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, applianceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [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, applianceName, options, callback) { + /* jshint 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 parameters = (options && options.parameters !== undefined) ? options.parameters : 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 (applianceName === null || applianceName === undefined || typeof applianceName.valueOf() !== 'string') { + throw new Error('applianceName cannot be null or undefined and it must be of type string.'); + } + if (applianceName !== null && applianceName !== undefined) { + if (applianceName.length > 64) + { + throw new Error('"applianceName" should satisfy the constraint - "MaxLength": 64'); + } + if (applianceName.length < 3) + { + throw new Error('"applianceName" should satisfy the constraint - "MinLength": 3'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances/{applianceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applianceName}', encodeURIComponent(applianceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Appliance']().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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the appliances within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {object} [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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances'; + 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the appliances within 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 ApplianceListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBySubscription(options, callback) { + /* jshint validthis: true */ + let 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Solutions/appliances'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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 Appliance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getById(applianceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (applianceId === null || applianceId === undefined || typeof applianceId.valueOf() !== 'string') { + throw new Error('applianceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{applianceId}'; + requestUrl = requestUrl.replace('{applianceId}', applianceId); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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 _deleteById(applianceId, options, callback) { + /* jshint 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.beginDeleteById(applianceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdateById(applianceId, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateById(applianceId, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateById(applianceId, options, callback) { + /* jshint 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 parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; + // Validate + try { + if (applianceId === null || applianceId === undefined || typeof applianceId.valueOf() !== 'string') { + throw new Error('applianceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{applianceId}'; + requestUrl = requestUrl.replace('{applianceId}', applianceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Appliance']().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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, applianceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (applianceName === null || applianceName === undefined || typeof applianceName.valueOf() !== 'string') { + throw new Error('applianceName cannot be null or undefined and it must be of type string.'); + } + if (applianceName !== null && applianceName !== undefined) { + if (applianceName.length > 64) + { + throw new Error('"applianceName" should satisfy the constraint - "MaxLength": 64'); + } + if (applianceName.length < 3) + { + throw new Error('"applianceName" should satisfy the constraint - "MinLength": 3'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances/{applianceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applianceName}', encodeURIComponent(applianceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [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, applianceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (applianceName === null || applianceName === undefined || typeof applianceName.valueOf() !== 'string') { + throw new Error('applianceName cannot be null or undefined and it must be of type string.'); + } + if (applianceName !== null && applianceName !== undefined) { + if (applianceName.length > 64) + { + throw new Error('"applianceName" should satisfy the constraint - "MaxLength": 64'); + } + if (applianceName.length < 3) + { + throw new Error('"applianceName" should satisfy the constraint - "MinLength": 3'); + } + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances/{applianceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{applianceName}', encodeURIComponent(applianceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Appliance']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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 _beginDeleteById(applianceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (applianceId === null || applianceId === undefined || typeof applianceId.valueOf() !== 'string') { + throw new Error('applianceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{applianceId}'; + requestUrl = requestUrl.replace('{applianceId}', applianceId); + let queryParameters = []; + queryParameters.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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdateById(applianceId, 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 (applianceId === null || applianceId === undefined || typeof applianceId.valueOf() !== 'string') { + throw new Error('applianceId cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{applianceId}'; + requestUrl = requestUrl.replace('{applianceId}', applianceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Appliance']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Appliance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['Appliance']().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); + }); +} + +/** + * Gets all the appliances within 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 ApplianceListResult} for more information. + * + * {object} [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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the appliances within 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 ApplianceListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBySubscriptionNext(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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplianceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Appliances. */ +class Appliances { + /** + * Create a Appliances. + * @param {ManagedApplicationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._listByResourceGroup = _listByResourceGroup; + this._listBySubscription = _listBySubscription; + this._getById = _getById; + this._deleteById = _deleteById; + this._createOrUpdateById = _createOrUpdateById; + this._updateById = _updateById; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteById = _beginDeleteById; + this._beginCreateOrUpdateById = _beginCreateOrUpdateById; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listBySubscriptionNext = _listBySubscriptionNext; + } + + /** + * Gets the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, applianceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {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, applianceName, options, optionalCallback) { + 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, applianceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, applianceName, options, optionalCallback); + } + } + + /** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, applianceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, applianceName, options, optionalCallback) { + 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, applianceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, applianceName, options, optionalCallback); + } + } + + /** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, applianceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {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, applianceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, applianceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, applianceName, parameters, options, optionalCallback); + } + } + + /** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers 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, applianceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, applianceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {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, applianceName, options, optionalCallback) { + 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, applianceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, applianceName, options, optionalCallback); + } + } + + /** + * Gets all the appliances within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Gets all the appliances within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplianceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {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); + } + } + + /** + * Gets all the appliances within 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. + */ + listBySubscriptionWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySubscription(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the appliances within 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 {ApplianceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscription(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBySubscription(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySubscription(options, optionalCallback); + } + } + + /** + * Gets the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + getByIdWithHttpOperationResponse(applianceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getById(applianceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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 {Appliance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getById(applianceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getById(applianceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getById(applianceId, options, optionalCallback); + } + } + + /** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + deleteByIdWithHttpOperationResponse(applianceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteById(applianceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + deleteById(applianceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteById(applianceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteById(applianceId, options, optionalCallback); + } + } + + /** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateByIdWithHttpOperationResponse(applianceId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateById(applianceId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateById(applianceId, 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._createOrUpdateById(applianceId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateById(applianceId, parameters, options, optionalCallback); + } + } + + /** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateByIdWithHttpOperationResponse(applianceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateById(applianceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateById(applianceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateById(applianceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateById(applianceId, options, optionalCallback); + } + } + + /** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, applianceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, applianceName, options, optionalCallback) { + 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, applianceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, applianceName, options, optionalCallback); + } + } + + /** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, applianceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, applianceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {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, applianceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, applianceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, applianceName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + beginDeleteByIdWithHttpOperationResponse(applianceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteById(applianceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + beginDeleteById(applianceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteById(applianceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteById(applianceId, options, optionalCallback); + } + } + + /** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateByIdWithHttpOperationResponse(applianceId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdateById(applianceId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdateById(applianceId, 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._beginCreateOrUpdateById(applianceId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdateById(applianceId, parameters, options, optionalCallback); + } + } + + /** + * Gets all the appliances within 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; + }); + }); + } + + /** + * Gets all the appliances within 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 {ApplianceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {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); + } + } + + /** + * Gets all the appliances within 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. + */ + listBySubscriptionNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the appliances within 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 {ApplianceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscriptionNext(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._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySubscriptionNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Appliances; diff --git a/lib/services/resourceManagement/lib/operations/index.d.ts b/lib/services/resourceManagement/lib/operations/index.d.ts new file mode 100644 index 0000000000..d3792fed68 --- /dev/null +++ b/lib/services/resourceManagement/lib/operations/index.d.ts @@ -0,0 +1,2697 @@ +/* + * 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 models from '../models'; + + +/** + * @class + * Appliances + * __NOTE__: An instance of this class is automatically created for an + * instance of the ManagedApplicationClient. + */ +export interface Appliances { + + + /** + * Gets the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Appliance} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {WebResource} [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, applianceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, applianceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, applianceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, applianceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, applianceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, applianceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceName: string, parameters: models.Appliance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Appliance} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {WebResource} [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, applianceName: string, parameters: models.Appliance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, applianceName: string, parameters: models.Appliance, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, applianceName: string, parameters: models.Appliance, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that 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, applianceName: string, options?: { parameters? : models.Appliance, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Appliance} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {WebResource} [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, applianceName: string, options?: { parameters? : models.Appliance, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, applianceName: string, callback: ServiceCallback): void; + update(resourceGroupName: string, applianceName: string, options: { parameters? : models.Appliance, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the appliances within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Gets all the appliances within a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplianceListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {WebResource} [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; + + + /** + * Gets all the appliances within 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. + */ + listBySubscriptionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the appliances within 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 {ApplianceListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscription(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscription(callback: ServiceCallback): void; + listBySubscription(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + getByIdWithHttpOperationResponse(applianceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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 {Appliance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Appliance} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getById(applianceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getById(applianceId: string, callback: ServiceCallback): void; + getById(applianceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + deleteByIdWithHttpOperationResponse(applianceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + deleteById(applianceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteById(applianceId: string, callback: ServiceCallback): void; + deleteById(applianceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateByIdWithHttpOperationResponse(applianceId: string, parameters: models.Appliance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Appliance} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateById(applianceId: string, parameters: models.Appliance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateById(applianceId: string, parameters: models.Appliance, callback: ServiceCallback): void; + createOrUpdateById(applianceId: string, parameters: models.Appliance, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateByIdWithHttpOperationResponse(applianceId: string, options?: { parameters? : models.Appliance, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an existing appliance. The only value that can be updated via PATCH + * currently is the tags. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update an + * existing appliance. + * + * @param {string} options.parameters.managedResourceGroupId The managed + * resource group Id. + * + * @param {string} [options.parameters.applianceDefinitionId] The fully + * qualified path of appliance definition Id. + * + * @param {object} [options.parameters.parameters] Name and value pairs that + * define the appliance parameters. It can be a JObject or a well formed JSON + * string. + * + * @param {string} [options.parameters.uiDefinitionUri] The blob URI where the + * UI definition file is located. + * + * @param {object} [options.parameters.plan] The plan information. + * + * @param {string} options.parameters.plan.name The plan name. + * + * @param {string} options.parameters.plan.publisher The publisher ID. + * + * @param {string} options.parameters.plan.product The product code. + * + * @param {string} [options.parameters.plan.promotionCode] The promotion code. + * + * @param {string} options.parameters.plan.version The plan's version. + * + * @param {string} [options.parameters.kind] The kind of the appliance. Allowed + * values are MarketPlace and ServiceCatalog. + * + * @param {string} [options.parameters.managedBy] ID of the resource that + * manages this resource. + * + * @param {object} [options.parameters.sku] The SKU of the resource. + * + * @param {string} options.parameters.sku.name The SKU name. + * + * @param {string} [options.parameters.sku.tier] The SKU tier. + * + * @param {string} [options.parameters.sku.size] The SKU size. + * + * @param {string} [options.parameters.sku.family] The SKU family. + * + * @param {string} [options.parameters.sku.model] The SKU model. + * + * @param {number} [options.parameters.sku.capacity] The SKU capacity. + * + * @param {object} [options.parameters.identity] The identity of the resource. + * + * @param {string} [options.parameters.identity.type] The identity type. + * Possible values include: 'SystemAssigned' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Appliance} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateById(applianceId: string, options?: { parameters? : models.Appliance, customHeaders? : { [headerName: string]: string; } }): Promise; + updateById(applianceId: string, callback: ServiceCallback): void; + updateById(applianceId: string, options: { parameters? : models.Appliance, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, applianceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, applianceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, applianceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceName: string, parameters: models.Appliance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new appliance. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceName The name of the appliance. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Appliance} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {WebResource} [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, applianceName: string, parameters: models.Appliance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, applianceName: string, parameters: models.Appliance, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, applianceName: string, parameters: models.Appliance, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + beginDeleteByIdWithHttpOperationResponse(applianceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-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. + */ + beginDeleteById(applianceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteById(applianceId: string, callback: ServiceCallback): void; + beginDeleteById(applianceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateByIdWithHttpOperationResponse(applianceId: string, parameters: models.Appliance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new appliance. + * + * @param {string} applianceId The fully qualified ID of the appliance, + * including the appliance name and the appliance resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance. + * + * @param {string} parameters.managedResourceGroupId The managed resource group + * Id. + * + * @param {string} [parameters.applianceDefinitionId] The fully qualified path + * of appliance definition Id. + * + * @param {object} [parameters.parameters] Name and value pairs that define the + * appliance parameters. It can be a JObject or a well formed JSON string. + * + * @param {string} [parameters.uiDefinitionUri] The blob URI where the UI + * definition file is located. + * + * @param {object} [parameters.plan] The plan information. + * + * @param {string} parameters.plan.name The plan name. + * + * @param {string} parameters.plan.publisher The publisher ID. + * + * @param {string} parameters.plan.product The product code. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.plan.version The plan's version. + * + * @param {string} [parameters.kind] The kind of the appliance. Allowed values + * are MarketPlace and ServiceCatalog. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Appliance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Appliance} [result] - The deserialized result object if an error did not occur. + * See {@link Appliance} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdateById(applianceId: string, parameters: models.Appliance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateById(applianceId: string, parameters: models.Appliance, callback: ServiceCallback): void; + beginCreateOrUpdateById(applianceId: string, parameters: models.Appliance, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all the appliances within 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>; + + /** + * Gets all the appliances within 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 {ApplianceListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {WebResource} [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; + + + /** + * Gets all the appliances within 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. + */ + listBySubscriptionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all the appliances within 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 {ApplianceListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySubscriptionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscriptionNext(nextPageLink: string, callback: ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ApplianceDefinitions + * __NOTE__: An instance of this class is automatically created for an + * instance of the ManagedApplicationClient. + */ +export interface ApplianceDefinitions { + + + /** + * Gets the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {WebResource} [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, applianceDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, applianceDefinitionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, applianceDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, applianceDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, applianceDefinitionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, applianceDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceDefinitionName: string, parameters: models.ApplianceDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {WebResource} [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, applianceDefinitionName: string, parameters: models.ApplianceDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, applianceDefinitionName: string, parameters: models.ApplianceDefinition, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, applianceDefinitionName: string, parameters: models.ApplianceDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the appliance definitions in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists the appliance definitions in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplianceDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinitionListResult} for more + * information. + * + * {WebResource} [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; + + + /** + * Gets the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + getByIdWithHttpOperationResponse(applianceDefinitionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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 {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getById(applianceDefinitionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getById(applianceDefinitionId: string, callback: ServiceCallback): void; + getById(applianceDefinitionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + deleteByIdWithHttpOperationResponse(applianceDefinitionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + deleteById(applianceDefinitionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteById(applianceDefinitionId: string, callback: ServiceCallback): void; + deleteById(applianceDefinitionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateByIdWithHttpOperationResponse(applianceDefinitionId: string, parameters: models.ApplianceDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateById(applianceDefinitionId: string, parameters: models.ApplianceDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateById(applianceDefinitionId: string, parameters: models.ApplianceDefinition, callback: ServiceCallback): void; + createOrUpdateById(applianceDefinitionId: string, parameters: models.ApplianceDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance definition + * to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, applianceDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, applianceDefinitionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, applianceDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, applianceDefinitionName: string, parameters: models.ApplianceDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new appliance definition. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} applianceDefinitionName The name of the appliance + * definition. + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {WebResource} [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, applianceDefinitionName: string, parameters: models.ApplianceDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, applianceDefinitionName: string, parameters: models.ApplianceDefinition, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, applianceDefinitionName: string, parameters: models.ApplianceDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + beginDeleteByIdWithHttpOperationResponse(applianceDefinitionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-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. + */ + beginDeleteById(applianceDefinitionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteById(applianceDefinitionId: string, callback: ServiceCallback): void; + beginDeleteById(applianceDefinitionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateByIdWithHttpOperationResponse(applianceDefinitionId: string, parameters: models.ApplianceDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new appliance definition. + * + * @param {string} applianceDefinitionId The fully qualified ID of the + * appliance definition, including the appliance name and the appliance + * definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * + * @param {object} parameters Parameters supplied to the create or update an + * appliance definition. + * + * @param {string} parameters.lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + * + * @param {string} [parameters.displayName] The appliance definition display + * name. + * + * @param {array} parameters.authorizations The appliance provider + * authorizations. + * + * @param {array} [parameters.artifacts] The collection of appliance artifacts. + * The portal will use the files specified as artifacts to construct the user + * experience of creating an appliance from an appliance definition. + * + * @param {string} [parameters.description] The appliance definition + * description. + * + * @param {string} parameters.packageFileUri The appliance definition package + * file Uri. + * + * @param {string} [parameters.managedBy] ID of the resource that manages this + * resource. + * + * @param {object} [parameters.sku] The SKU of the resource. + * + * @param {string} parameters.sku.name The SKU name. + * + * @param {string} [parameters.sku.tier] The SKU tier. + * + * @param {string} [parameters.sku.size] The SKU size. + * + * @param {string} [parameters.sku.family] The SKU family. + * + * @param {string} [parameters.sku.model] The SKU model. + * + * @param {number} [parameters.sku.capacity] The SKU capacity. + * + * @param {object} [parameters.identity] The identity of the resource. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplianceDefinition} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinition} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdateById(applianceDefinitionId: string, parameters: models.ApplianceDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateById(applianceDefinitionId: string, parameters: models.ApplianceDefinition, callback: ServiceCallback): void; + beginCreateOrUpdateById(applianceDefinitionId: string, parameters: models.ApplianceDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the appliance definitions 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>; + + /** + * Lists the appliance definitions 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 {ApplianceDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplianceDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ApplianceDefinitionListResult} for more + * information. + * + * {WebResource} [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; +} diff --git a/lib/services/resourceManagement/lib/operations/index.js b/lib/services/resourceManagement/lib/operations/index.js new file mode 100644 index 0000000000..bcc97ad8c9 --- /dev/null +++ b/lib/services/resourceManagement/lib/operations/index.js @@ -0,0 +1,18 @@ +/* + * 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'; + +exports.Appliances = require('./appliances'); +exports.ApplianceDefinitions = require('./applianceDefinitions'); diff --git a/lib/services/resourceManagement/lib/policy/models/errorResponse.js b/lib/services/resourceManagement/lib/policy/models/errorResponse.js index 2915f7c2e0..c138f91bdc 100644 --- a/lib/services/resourceManagement/lib/policy/models/errorResponse.js +++ b/lib/services/resourceManagement/lib/policy/models/errorResponse.js @@ -11,8 +11,8 @@ 'use strict'; /** - * Error reponse indicates ARM is not able to process the incoming request. The - * reason is provided in the error message. + * Error reponse indicates Azure Resource Manager is not able to process the + * incoming request. The reason is provided in the error message. * */ class ErrorResponse { diff --git a/lib/services/resourceManagement/lib/policy/models/identity.js b/lib/services/resourceManagement/lib/policy/models/identity.js new file mode 100644 index 0000000000..011840ff14 --- /dev/null +++ b/lib/services/resourceManagement/lib/policy/models/identity.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Identity for the resource. + * + */ +class Identity { + /** + * Create a Identity. + * @member {string} [principalId] The principal ID of the resource identity. + * @member {string} [tenantId] The tenant ID of the resource identity. + * @member {string} [type] The identity type. Possible values include: + * 'SystemAssigned', 'None' + */ + constructor() { + } + + /** + * Defines the metadata of Identity + * + * @returns {object} metadata of Identity + * + */ + mapper() { + return { + required: false, + serializedName: 'Identity', + type: { + name: 'Composite', + className: 'Identity', + modelProperties: { + principalId: { + required: false, + readOnly: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + tenantId: { + required: false, + readOnly: true, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'SystemAssigned', 'None' ] + } + } + } + } + }; + } +} + +module.exports = Identity; diff --git a/lib/services/resourceManagement/lib/policy/models/index.d.ts b/lib/services/resourceManagement/lib/policy/models/index.d.ts index 73dcae16ee..ce79d5809a 100644 --- a/lib/services/resourceManagement/lib/policy/models/index.d.ts +++ b/lib/services/resourceManagement/lib/policy/models/index.d.ts @@ -20,7 +20,7 @@ export { CloudError } from 'ms-rest-azure'; * @class * Initializes a new instance of the PolicySku class. * @constructor - * The policy sku. + * The policy sku. This property is optional, obsolete, and will be ignored. * * @member {string} name The name of the policy sku. Possible values are A0 and * A1. @@ -32,6 +32,23 @@ export interface PolicySku { tier?: string; } +/** + * @class + * Initializes a new instance of the Identity class. + * @constructor + * Identity for the resource. + * + * @member {string} [principalId] The principal ID of the resource identity. + * @member {string} [tenantId] The tenant ID of the resource identity. + * @member {string} [type] The identity type. Possible values include: + * 'SystemAssigned', 'None' + */ +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type?: string; +} + /** * @class * Initializes a new instance of the PolicyAssignment class. @@ -39,7 +56,8 @@ export interface PolicySku { * The policy assignment. * * @member {string} [displayName] The display name of the policy assignment. - * @member {string} [policyDefinitionId] The ID of the policy definition. + * @member {string} [policyDefinitionId] The ID of the policy definition or + * policy set definition being assigned. * @member {string} [scope] The scope for the policy assignment. * @member {array} [notScopes] The policy's excluded scopes. * @member {object} [parameters] Required if a parameter is used in policy @@ -50,11 +68,21 @@ export interface PolicySku { * @member {string} [id] The ID of the policy assignment. * @member {string} [type] The type of the policy assignment. * @member {string} [name] The name of the policy assignment. - * @member {object} [sku] The policy sku. + * @member {object} [sku] The policy sku. This property is optional, obsolete, + * and will be ignored. * @member {string} [sku.name] The name of the policy sku. Possible values are * A0 and A1. * @member {string} [sku.tier] The policy sku tier. Possible values are Free * and Standard. + * @member {string} [location] The location of the policy assignment. Only + * required when utilizing managed identity. + * @member {object} [identity] The managed identity associated with the policy + * assignment. + * @member {string} [identity.principalId] The principal ID of the resource + * identity. + * @member {string} [identity.tenantId] The tenant ID of the resource identity. + * @member {string} [identity.type] The identity type. Possible values include: + * 'SystemAssigned', 'None' */ export interface PolicyAssignment extends BaseResource { displayName?: string; @@ -68,14 +96,16 @@ export interface PolicyAssignment extends BaseResource { readonly type?: string; readonly name?: string; sku?: PolicySku; + location?: string; + identity?: Identity; } /** * @class * Initializes a new instance of the ErrorResponse class. * @constructor - * Error reponse indicates ARM is not able to process the incoming request. The - * reason is provided in the error message. + * Error reponse indicates Azure Resource Manager is not able to process the + * incoming request. The reason is provided in the error message. * * @member {string} [httpStatus] Http status code. * @member {string} [errorCode] Error code. @@ -88,6 +118,42 @@ export interface ErrorResponse { errorMessage?: string; } +/** + * @class + * Initializes a new instance of the PolicyDefinition class. + * @constructor + * The policy definition. + * + * @member {string} [policyType] The type of policy definition. Possible values + * are NotSpecified, BuiltIn, and Custom. Possible values include: + * 'NotSpecified', 'BuiltIn', 'Custom' + * @member {string} [mode] The policy definition mode. Possible values are + * NotSpecified, Indexed, and All. Possible values include: 'NotSpecified', + * 'Indexed', 'All' + * @member {string} [displayName] The display name of the policy definition. + * @member {string} [description] The policy definition description. + * @member {object} [policyRule] The policy rule. + * @member {object} [metadata] The policy definition metadata. + * @member {object} [parameters] Required if a parameter is used in policy + * rule. + * @member {string} [id] The ID of the policy definition. + * @member {string} [name] The name of the policy definition. + * @member {string} [type] The type of the resource + * (Microsoft.Authorization/policyDefinitions). + */ +export interface PolicyDefinition extends BaseResource { + policyType?: string; + mode?: string; + displayName?: string; + description?: string; + policyRule?: any; + metadata?: any; + parameters?: any; + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + /** * @class * Initializes a new instance of the PolicyDefinitionReference class. @@ -137,39 +203,6 @@ export interface PolicySetDefinition extends BaseResource { readonly type?: string; } -/** - * @class - * Initializes a new instance of the PolicyDefinition class. - * @constructor - * The policy definition. - * - * @member {string} [policyType] The type of policy definition. Possible values - * are NotSpecified, BuiltIn, and Custom. Possible values include: - * 'NotSpecified', 'BuiltIn', 'Custom' - * @member {string} [mode] The policy definition mode. Possible values are - * NotSpecified, Indexed, and All. Possible values include: 'NotSpecified', - * 'Indexed', 'All' - * @member {string} [displayName] The display name of the policy definition. - * @member {string} [description] The policy definition description. - * @member {object} [policyRule] The policy rule. - * @member {object} [metadata] The policy definition metadata. - * @member {object} [parameters] Required if a parameter is used in policy - * rule. - * @member {string} [id] The ID of the policy definition. - * @member {string} [name] The name of the policy definition. - */ -export interface PolicyDefinition extends BaseResource { - policyType?: string; - mode?: string; - displayName?: string; - description?: string; - policyRule?: any; - metadata?: any; - parameters?: any; - readonly id?: string; - readonly name?: string; -} - /** * @class @@ -186,26 +219,26 @@ export interface PolicyAssignmentListResult extends Array { /** * @class - * Initializes a new instance of the PolicySetDefinitionListResult class. + * Initializes a new instance of the PolicyDefinitionListResult class. * @constructor - * List of policy set definitions. + * List of policy definitions. * * @member {string} [nextLink] The URL to use for getting the next set of * results. */ -export interface PolicySetDefinitionListResult extends Array { +export interface PolicyDefinitionListResult extends Array { nextLink?: string; } /** * @class - * Initializes a new instance of the PolicyDefinitionListResult class. + * Initializes a new instance of the PolicySetDefinitionListResult class. * @constructor - * List of policy definitions. + * List of policy set definitions. * * @member {string} [nextLink] The URL to use for getting the next set of * results. */ -export interface PolicyDefinitionListResult extends Array { +export interface PolicySetDefinitionListResult extends Array { nextLink?: string; } diff --git a/lib/services/resourceManagement/lib/policy/models/index.js b/lib/services/resourceManagement/lib/policy/models/index.js index 397b947f9d..f8894cbb21 100644 --- a/lib/services/resourceManagement/lib/policy/models/index.js +++ b/lib/services/resourceManagement/lib/policy/models/index.js @@ -19,11 +19,12 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.PolicySku = require('./policySku'); +exports.Identity = require('./identity'); exports.PolicyAssignment = require('./policyAssignment'); exports.ErrorResponse = require('./errorResponse'); +exports.PolicyDefinition = require('./policyDefinition'); exports.PolicyDefinitionReference = require('./policyDefinitionReference'); exports.PolicySetDefinition = require('./policySetDefinition'); -exports.PolicyDefinition = require('./policyDefinition'); exports.PolicyAssignmentListResult = require('./policyAssignmentListResult'); -exports.PolicySetDefinitionListResult = require('./policySetDefinitionListResult'); exports.PolicyDefinitionListResult = require('./policyDefinitionListResult'); +exports.PolicySetDefinitionListResult = require('./policySetDefinitionListResult'); diff --git a/lib/services/resourceManagement/lib/policy/models/policyAssignment.js b/lib/services/resourceManagement/lib/policy/models/policyAssignment.js index 295cb165de..34b7852a0c 100644 --- a/lib/services/resourceManagement/lib/policy/models/policyAssignment.js +++ b/lib/services/resourceManagement/lib/policy/models/policyAssignment.js @@ -21,7 +21,8 @@ class PolicyAssignment extends models['BaseResource'] { /** * Create a PolicyAssignment. * @member {string} [displayName] The display name of the policy assignment. - * @member {string} [policyDefinitionId] The ID of the policy definition. + * @member {string} [policyDefinitionId] The ID of the policy definition or + * policy set definition being assigned. * @member {string} [scope] The scope for the policy assignment. * @member {array} [notScopes] The policy's excluded scopes. * @member {object} [parameters] Required if a parameter is used in policy @@ -32,11 +33,22 @@ class PolicyAssignment extends models['BaseResource'] { * @member {string} [id] The ID of the policy assignment. * @member {string} [type] The type of the policy assignment. * @member {string} [name] The name of the policy assignment. - * @member {object} [sku] The policy sku. + * @member {object} [sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * @member {string} [sku.name] The name of the policy sku. Possible values * are A0 and A1. * @member {string} [sku.tier] The policy sku tier. Possible values are Free * and Standard. + * @member {string} [location] The location of the policy assignment. Only + * required when utilizing managed identity. + * @member {object} [identity] The managed identity associated with the + * policy assignment. + * @member {string} [identity.principalId] The principal ID of the resource + * identity. + * @member {string} [identity.tenantId] The tenant ID of the resource + * identity. + * @member {string} [identity.type] The identity type. Possible values + * include: 'SystemAssigned', 'None' */ constructor() { super(); @@ -143,6 +155,21 @@ class PolicyAssignment extends models['BaseResource'] { name: 'Composite', className: 'PolicySku' } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'Identity' + } } } } diff --git a/lib/services/resourceManagement/lib/policy/models/policyDefinition.js b/lib/services/resourceManagement/lib/policy/models/policyDefinition.js index aa2181dc7e..7b7d078b11 100644 --- a/lib/services/resourceManagement/lib/policy/models/policyDefinition.js +++ b/lib/services/resourceManagement/lib/policy/models/policyDefinition.js @@ -34,6 +34,8 @@ class PolicyDefinition extends models['BaseResource'] { * rule. * @member {string} [id] The ID of the policy definition. * @member {string} [name] The name of the policy definition. + * @member {string} [type] The type of the resource + * (Microsoft.Authorization/policyDefinitions). */ constructor() { super(); @@ -117,6 +119,14 @@ class PolicyDefinition extends models['BaseResource'] { type: { name: 'String' } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } } } } diff --git a/lib/services/resourceManagement/lib/policy/models/policySku.js b/lib/services/resourceManagement/lib/policy/models/policySku.js index 33c96fec1e..69b4f0a9b9 100644 --- a/lib/services/resourceManagement/lib/policy/models/policySku.js +++ b/lib/services/resourceManagement/lib/policy/models/policySku.js @@ -11,7 +11,7 @@ 'use strict'; /** - * The policy sku. + * The policy sku. This property is optional, obsolete, and will be ignored. * */ class PolicySku { diff --git a/lib/services/resourceManagement/lib/policy/operations/index.d.ts b/lib/services/resourceManagement/lib/policy/operations/index.d.ts index f5a6454d9f..49b2d2cd86 100644 --- a/lib/services/resourceManagement/lib/policy/operations/index.d.ts +++ b/lib/services/resourceManagement/lib/policy/operations/index.d.ts @@ -22,9 +22,21 @@ export interface PolicyAssignments { /** - * Deletes a policy assignment. - * - * @param {string} scope The scope of the policy assignment. + * @summary Deletes a policy assignment. + * + * This operation deletes a policy assignment, given its name and the scope it + * was created in. The scope of a policy assignment is the part of its ID + * preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * delete. @@ -43,9 +55,21 @@ export interface PolicyAssignments { deleteMethodWithHttpOperationResponse(scope: string, policyAssignmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a policy assignment. + * @summary Deletes a policy assignment. + * + * This operation deletes a policy assignment, given its name and the scope it + * was created in. The scope of a policy assignment is the part of its ID + * preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * @param {string} scope The scope of the policy assignment. + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * delete. @@ -83,13 +107,21 @@ export interface PolicyAssignments { /** - * @summary Creates a policy assignment. + * @summary Creates or updates a policy assignment. * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. + * This operation creates or updates a policy assignment with the given scope + * and name. Policy assignments apply to all resources contained within their + * scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param {string} scope The scope of the policy assignment. + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment. * @@ -99,7 +131,7 @@ export interface PolicyAssignments { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -113,7 +145,8 @@ export interface PolicyAssignments { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -121,6 +154,15 @@ export interface PolicyAssignments { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -135,13 +177,21 @@ export interface PolicyAssignments { createWithHttpOperationResponse(scope: string, policyAssignmentName: string, parameters: models.PolicyAssignment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Creates a policy assignment. + * @summary Creates or updates a policy assignment. * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. + * This operation creates or updates a policy assignment with the given scope + * and name. Policy assignments apply to all resources contained within their + * scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param {string} scope The scope of the policy assignment. + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment. * @@ -151,7 +201,7 @@ export interface PolicyAssignments { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -165,7 +215,8 @@ export interface PolicyAssignments { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -173,6 +224,15 @@ export interface PolicyAssignments { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -206,9 +266,19 @@ export interface PolicyAssignments { /** - * Gets a policy assignment. + * @summary Retrieves a policy assignment. * - * @param {string} scope The scope of the policy assignment. + * This operation retrieves a single policy assignment, given its name and the + * scope it was created at. + * + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * get. @@ -227,9 +297,19 @@ export interface PolicyAssignments { getWithHttpOperationResponse(scope: string, policyAssignmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a policy assignment. + * @summary Retrieves a policy assignment. + * + * This operation retrieves a single policy assignment, given its name and the + * scope it was created at. * - * @param {string} scope The scope of the policy assignment. + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * get. @@ -267,14 +347,30 @@ export interface PolicyAssignments { /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} resourceGroupName The name of the resource group that * contains policy assignments. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -288,14 +384,30 @@ export interface PolicyAssignments { listForResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} resourceGroupName The name of the resource group that * contains policy assignments. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -329,24 +441,56 @@ export interface PolicyAssignments { /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} resourceGroupName The name of the resource group containing - * the resource. The name is case insensitive. + * the resource. * * @param {string} resourceProviderNamespace The namespace of the resource - * provider. + * provider. For example, the namespace of a virtual machine is + * Microsoft.Compute (from Microsoft.Compute/virtualMachines) * - * @param {string} parentResourcePath The parent resource path. + * @param {string} parentResourcePath The parent resource path. Use empty + * string if there is none. * - * @param {string} resourceType The resource type. + * @param {string} resourceType The resource type name. For example the type + * name of a web app is 'sites' (from Microsoft.Web/sites). * - * @param {string} resourceName The name of the resource with policy - * assignments. + * @param {string} resourceName The name of the resource. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -360,24 +504,56 @@ export interface PolicyAssignments { listForResourceWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} resourceGroupName The name of the resource group containing - * the resource. The name is case insensitive. + * the resource. * * @param {string} resourceProviderNamespace The namespace of the resource - * provider. + * provider. For example, the namespace of a virtual machine is + * Microsoft.Compute (from Microsoft.Compute/virtualMachines) * - * @param {string} parentResourcePath The parent resource path. + * @param {string} parentResourcePath The parent resource path. Use empty + * string if there is none. * - * @param {string} resourceType The resource type. + * @param {string} resourceType The resource type name. For example the type + * name of a web app is 'sites' (from Microsoft.Web/sites). * - * @param {string} resourceName The name of the resource with policy - * assignments. + * @param {string} resourceName The name of the resource. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -411,11 +587,27 @@ export interface PolicyAssignments { /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -429,11 +621,27 @@ export interface PolicyAssignments { listWithHttpOperationResponse(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -467,18 +675,22 @@ export interface PolicyAssignments { /** - * @summary Deletes a policy assignment by ID. + * @summary Deletes a policy assignment. * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * This operation deletes the policy with the given ID. Policy assignment IDs + * have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid formats for {scope} are: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}' + * (management group), '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + * (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * * @param {string} policyAssignmentId The ID of the policy assignment to * delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -494,18 +706,22 @@ export interface PolicyAssignments { deleteByIdWithHttpOperationResponse(policyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Deletes a policy assignment by ID. + * @summary Deletes a policy assignment. * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * This operation deletes the policy with the given ID. Policy assignment IDs + * have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid formats for {scope} are: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}' + * (management group), '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + * (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * * @param {string} policyAssignmentId The ID of the policy assignment to * delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -540,20 +756,25 @@ export interface PolicyAssignments { /** - * @summary Creates a policy assignment by ID. + * @summary Creates or updates a policy assignment. * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * This operation creates or updates the policy assignment with the given ID. + * Policy assignments made on a scope apply to all resources contained in that + * scope. For example, when you assign a policy to a resource group that policy + * applies to all resources in the group. Policy assignment IDs have this + * format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to * create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} parameters Parameters for policy assignment. * @@ -561,7 +782,7 @@ export interface PolicyAssignments { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -575,7 +796,8 @@ export interface PolicyAssignments { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -583,6 +805,15 @@ export interface PolicyAssignments { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -597,20 +828,25 @@ export interface PolicyAssignments { createByIdWithHttpOperationResponse(policyAssignmentId: string, parameters: models.PolicyAssignment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Creates a policy assignment by ID. + * @summary Creates or updates a policy assignment. * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * This operation creates or updates the policy assignment with the given ID. + * Policy assignments made on a scope apply to all resources contained in that + * scope. For example, when you assign a policy to a resource group that policy + * applies to all resources in the group. Policy assignment IDs have this + * format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to * create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} parameters Parameters for policy assignment. * @@ -618,7 +854,7 @@ export interface PolicyAssignments { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -632,7 +868,8 @@ export interface PolicyAssignments { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -640,6 +877,15 @@ export interface PolicyAssignments { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -673,18 +919,22 @@ export interface PolicyAssignments { /** - * @summary Gets a policy assignment by ID. + * @summary Retrieves the policy assignment with the given ID. * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * The operation retrieves the policy assignment with the given ID. Policy + * assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to get. * Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -700,18 +950,22 @@ export interface PolicyAssignments { getByIdWithHttpOperationResponse(policyAssignmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets a policy assignment by ID. + * @summary Retrieves the policy assignment with the given ID. * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * The operation retrieves the policy assignment with the given ID. Policy + * assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to get. * Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -746,7 +1000,21 @@ export interface PolicyAssignments { /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -765,7 +1033,21 @@ export interface PolicyAssignments { listForResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -804,7 +1086,35 @@ export interface PolicyAssignments { /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -823,7 +1133,35 @@ export interface PolicyAssignments { listForResourceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -862,7 +1200,21 @@ export interface PolicyAssignments { /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -881,7 +1233,21 @@ export interface PolicyAssignments { listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -921,38 +1287,43 @@ export interface PolicyAssignments { /** * @class - * PolicySetDefinitions + * PolicyDefinitions * __NOTE__: An instance of this class is automatically created for an * instance of the PolicyClient. */ -export interface PolicySetDefinitions { +export interface PolicyDefinitions { /** - * Creates or updates a policy set definition. + * @summary Creates or updates a policy definition in a subscription. * - * @param {string} policySetDefinitionName The name of the policy set - * definition to create. + * This operation creates or updates a policy definition in the given + * subscription with the given name. * - * @param {object} parameters The policy set definition properties. + * @param {string} policyDefinitionName The name of the policy definition to + * create. + * + * @param {object} parameters The policy definition properties. * * @param {string} [parameters.policyType] The type of policy definition. * Possible values are NotSpecified, BuiltIn, and Custom. Possible values * include: 'NotSpecified', 'BuiltIn', 'Custom' * - * @param {string} [parameters.displayName] The display name of the policy set + * @param {string} [parameters.mode] The policy definition mode. Possible + * values are NotSpecified, Indexed, and All. Possible values include: + * 'NotSpecified', 'Indexed', 'All' + * + * @param {string} [parameters.displayName] The display name of the policy * definition. * - * @param {string} [parameters.description] The policy set definition - * description. + * @param {string} [parameters.description] The policy definition description. * - * @param {object} [parameters.metadata] The policy set definition metadata. + * @param {object} [parameters.policyRule] The policy rule. * - * @param {object} [parameters.parameters] The policy set definition parameters - * that can be used in policy definition references. + * @param {object} [parameters.metadata] The policy definition metadata. * - * @param {array} parameters.policyDefinitions An array of policy definition - * references. + * @param {object} [parameters.parameters] Required if a parameter is used in + * policy rule. * * @param {object} [options] Optional Parameters. * @@ -961,37 +1332,42 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(policySetDefinitionName: string, parameters: models.PolicySetDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(policyDefinitionName: string, parameters: models.PolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a policy set definition. + * @summary Creates or updates a policy definition in a subscription. * - * @param {string} policySetDefinitionName The name of the policy set - * definition to create. + * This operation creates or updates a policy definition in the given + * subscription with the given name. * - * @param {object} parameters The policy set definition properties. + * @param {string} policyDefinitionName The name of the policy definition to + * create. + * + * @param {object} parameters The policy definition properties. * * @param {string} [parameters.policyType] The type of policy definition. * Possible values are NotSpecified, BuiltIn, and Custom. Possible values * include: 'NotSpecified', 'BuiltIn', 'Custom' * - * @param {string} [parameters.displayName] The display name of the policy set + * @param {string} [parameters.mode] The policy definition mode. Possible + * values are NotSpecified, Indexed, and All. Possible values include: + * 'NotSpecified', 'Indexed', 'All' + * + * @param {string} [parameters.displayName] The display name of the policy * definition. * - * @param {string} [parameters.description] The policy set definition - * description. + * @param {string} [parameters.description] The policy definition description. * - * @param {object} [parameters.metadata] The policy set definition metadata. + * @param {object} [parameters.policyRule] The policy rule. * - * @param {object} [parameters.parameters] The policy set definition parameters - * that can be used in policy definition references. + * @param {object} [parameters.metadata] The policy definition metadata. * - * @param {array} parameters.policyDefinitions An array of policy definition - * references. + * @param {object} [parameters.parameters] Required if a parameter is used in + * policy rule. * * @param {object} [options] Optional Parameters. * @@ -1005,7 +1381,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinition} - The deserialized result object. + * @resolve {PolicyDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1013,23 +1389,26 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinition} for more information. + * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinition} for more information. * * {WebResource} [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(policySetDefinitionName: string, parameters: models.PolicySetDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(policySetDefinitionName: string, parameters: models.PolicySetDefinition, callback: ServiceCallback): void; - createOrUpdate(policySetDefinitionName: string, parameters: models.PolicySetDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(policyDefinitionName: string, parameters: models.PolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(policyDefinitionName: string, parameters: models.PolicyDefinition, callback: ServiceCallback): void; + createOrUpdate(policyDefinitionName: string, parameters: models.PolicyDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a policy set definition. + * @summary Deletes a policy definition in a subscription. * - * @param {string} policySetDefinitionName The name of the policy set - * definition to delete. + * This operation deletes the policy definition in the given subscription with + * the given name. + * + * @param {string} policyDefinitionName The name of the policy definition to + * delete. * * @param {object} [options] Optional Parameters. * @@ -1042,13 +1421,16 @@ export interface PolicySetDefinitions { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a policy set definition. + * @summary Deletes a policy definition in a subscription. * - * @param {string} policySetDefinitionName The name of the policy set - * definition to delete. + * This operation deletes the policy definition in the given subscription with + * the given name. + * + * @param {string} policyDefinitionName The name of the policy definition to + * delete. * * @param {object} [options] Optional Parameters. * @@ -1076,16 +1458,19 @@ export interface PolicySetDefinitions { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(policySetDefinitionName: string, callback: ServiceCallback): void; - deleteMethod(policySetDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(policyDefinitionName: string, callback: ServiceCallback): void; + deleteMethod(policyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the policy set definition. + * @summary Retrieves a policy definition in a subscription. * - * @param {string} policySetDefinitionName The name of the policy set - * definition to get. + * This operation retrieves the policy definition in the given subscription + * with the given name. + * + * @param {string} policyDefinitionName The name of the policy definition to + * get. * * @param {object} [options] Optional Parameters. * @@ -1094,17 +1479,20 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the policy set definition. + * @summary Retrieves a policy definition in a subscription. * - * @param {string} policySetDefinitionName The name of the policy set - * definition to get. + * This operation retrieves the policy definition in the given subscription + * with the given name. + * + * @param {string} policyDefinitionName The name of the policy definition to + * get. * * @param {object} [options] Optional Parameters. * @@ -1118,7 +1506,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinition} - The deserialized result object. + * @resolve {PolicyDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1126,22 +1514,24 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinition} for more information. + * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinition} for more information. * * {WebResource} [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(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(policySetDefinitionName: string, callback: ServiceCallback): void; - get(policySetDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(policyDefinitionName: string, callback: ServiceCallback): void; + get(policyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the built in policy set definition. + * @summary Retrieves a built-in policy definition. * - * @param {string} policySetDefinitionName The name of the policy set + * This operation retrieves the built-in policy definition with the given name. + * + * @param {string} policyDefinitionName The name of the built-in policy * definition to get. * * @param {object} [options] Optional Parameters. @@ -1151,16 +1541,18 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getBuiltInWithHttpOperationResponse(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getBuiltInWithHttpOperationResponse(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the built in policy set definition. + * @summary Retrieves a built-in policy definition. * - * @param {string} policySetDefinitionName The name of the policy set + * This operation retrieves the built-in policy definition with the given name. + * + * @param {string} policyDefinitionName The name of the built-in policy * definition to get. * * @param {object} [options] Optional Parameters. @@ -1175,7 +1567,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinition} - The deserialized result object. + * @resolve {PolicyDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1183,20 +1575,50 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinition} for more information. + * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinition} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getBuiltIn(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBuiltIn(policySetDefinitionName: string, callback: ServiceCallback): void; - getBuiltIn(policySetDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getBuiltIn(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBuiltIn(policyDefinitionName: string, callback: ServiceCallback): void; + getBuiltIn(policyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the policy set definitions for a subscription. + * @summary Creates or updates a policy definition in a management group. + * + * This operation creates or updates a policy definition in the given + * management group with the given name. + * + * @param {string} policyDefinitionName The name of the policy definition to + * create. + * + * @param {object} parameters The policy definition properties. + * + * @param {string} [parameters.policyType] The type of policy definition. + * Possible values are NotSpecified, BuiltIn, and Custom. Possible values + * include: 'NotSpecified', 'BuiltIn', 'Custom' + * + * @param {string} [parameters.mode] The policy definition mode. Possible + * values are NotSpecified, Indexed, and All. Possible values include: + * 'NotSpecified', 'Indexed', 'All' + * + * @param {string} [parameters.displayName] The display name of the policy + * definition. + * + * @param {string} [parameters.description] The policy definition description. + * + * @param {object} [parameters.policyRule] The policy rule. + * + * @param {object} [parameters.metadata] The policy definition metadata. + * + * @param {object} [parameters.parameters] Required if a parameter is used in + * policy rule. + * + * @param {string} managementGroupId The ID of the management group. * * @param {object} [options] Optional Parameters. * @@ -1205,14 +1627,44 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateAtManagementGroupWithHttpOperationResponse(policyDefinitionName: string, parameters: models.PolicyDefinition, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy set definitions for a subscription. + * @summary Creates or updates a policy definition in a management group. + * + * This operation creates or updates a policy definition in the given + * management group with the given name. + * + * @param {string} policyDefinitionName The name of the policy definition to + * create. + * + * @param {object} parameters The policy definition properties. + * + * @param {string} [parameters.policyType] The type of policy definition. + * Possible values are NotSpecified, BuiltIn, and Custom. Possible values + * include: 'NotSpecified', 'BuiltIn', 'Custom' + * + * @param {string} [parameters.mode] The policy definition mode. Possible + * values are NotSpecified, Indexed, and All. Possible values include: + * 'NotSpecified', 'Indexed', 'All' + * + * @param {string} [parameters.displayName] The display name of the policy + * definition. + * + * @param {string} [parameters.description] The policy definition description. + * + * @param {object} [parameters.policyRule] The policy rule. + * + * @param {object} [parameters.metadata] The policy definition metadata. + * + * @param {object} [parameters.parameters] Required if a parameter is used in + * policy rule. + * + * @param {string} managementGroupId The ID of the management group. * * @param {object} [options] Optional Parameters. * @@ -1226,7 +1678,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinitionListResult} - The deserialized result object. + * @resolve {PolicyDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1234,21 +1686,28 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinitionListResult} for more - * information. + * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinition} for more information. * * {WebResource} [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; + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: models.PolicyDefinition, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: models.PolicyDefinition, managementGroupId: string, callback: ServiceCallback): void; + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: models.PolicyDefinition, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the built in policy set definitions. + * @summary Deletes a policy definition in a management group. + * + * This operation deletes the policy definition in the given management group + * with the given name. + * + * @param {string} policyDefinitionName The name of the policy definition to + * delete. + * + * @param {string} managementGroupId The ID of the management group. * * @param {object} [options] Optional Parameters. * @@ -1257,14 +1716,22 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBuiltInWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteAtManagementGroupWithHttpOperationResponse(policyDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the built in policy set definitions. + * @summary Deletes a policy definition in a management group. + * + * This operation deletes the policy definition in the given management group + * with the given name. + * + * @param {string} policyDefinitionName The name of the policy definition to + * delete. + * + * @param {string} managementGroupId The ID of the management group. * * @param {object} [options] Optional Parameters. * @@ -1278,7 +1745,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinitionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1286,44 +1753,25 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinitionListResult} for more - * information. + * {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. */ - listBuiltIn(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBuiltIn(callback: ServiceCallback): void; - listBuiltIn(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, callback: ServiceCallback): void; + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a policy set definition at management group level. - * - * @param {string} policySetDefinitionName The name of the policy set - * definition to create. - * - * @param {object} parameters The policy set definition properties. - * - * @param {string} [parameters.policyType] The type of policy definition. - * Possible values are NotSpecified, BuiltIn, and Custom. Possible values - * include: 'NotSpecified', 'BuiltIn', 'Custom' + * @summary Retrieve a policy definition in a management group. * - * @param {string} [parameters.displayName] The display name of the policy set - * definition. - * - * @param {string} [parameters.description] The policy set definition - * description. - * - * @param {object} [parameters.metadata] The policy set definition metadata. - * - * @param {object} [parameters.parameters] The policy set definition parameters - * that can be used in policy definition references. + * This operation retrieves the policy definition in the given management group + * with the given name. * - * @param {array} parameters.policyDefinitions An array of policy definition - * references. + * @param {string} policyDefinitionName The name of the policy definition to + * get. * * @param {string} managementGroupId The ID of the management group. * @@ -1334,37 +1782,20 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateAtManagementGroupWithHttpOperationResponse(policySetDefinitionName: string, parameters: models.PolicySetDefinition, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getAtManagementGroupWithHttpOperationResponse(policyDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a policy set definition at management group level. - * - * @param {string} policySetDefinitionName The name of the policy set - * definition to create. - * - * @param {object} parameters The policy set definition properties. - * - * @param {string} [parameters.policyType] The type of policy definition. - * Possible values are NotSpecified, BuiltIn, and Custom. Possible values - * include: 'NotSpecified', 'BuiltIn', 'Custom' - * - * @param {string} [parameters.displayName] The display name of the policy set - * definition. - * - * @param {string} [parameters.description] The policy set definition - * description. - * - * @param {object} [parameters.metadata] The policy set definition metadata. + * @summary Retrieve a policy definition in a management group. * - * @param {object} [parameters.parameters] The policy set definition parameters - * that can be used in policy definition references. + * This operation retrieves the policy definition in the given management group + * with the given name. * - * @param {array} parameters.policyDefinitions An array of policy definition - * references. + * @param {string} policyDefinitionName The name of the policy definition to + * get. * * @param {string} managementGroupId The ID of the management group. * @@ -1380,7 +1811,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinition} - The deserialized result object. + * @resolve {PolicyDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1388,25 +1819,23 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinition} for more information. + * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinition} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: models.PolicySetDefinition, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: models.PolicySetDefinition, managementGroupId: string, callback: ServiceCallback): void; - createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: models.PolicySetDefinition, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, callback: ServiceCallback): void; + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a policy set definition at management group level. - * - * @param {string} policySetDefinitionName The name of the policy set - * definition to delete. + * @summary Retrieves policy definitions in a subscription * - * @param {string} managementGroupId The ID of the management group. + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {object} [options] Optional Parameters. * @@ -1415,19 +1844,17 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteAtManagementGroupWithHttpOperationResponse(policySetDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a policy set definition at management group level. - * - * @param {string} policySetDefinitionName The name of the policy set - * definition to delete. + * @summary Retrieves policy definitions in a subscription * - * @param {string} managementGroupId The ID of the management group. + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {object} [options] Optional Parameters. * @@ -1441,7 +1868,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PolicyDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1449,24 +1876,23 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, callback: ServiceCallback): void; - deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the policy set definition at management group level. - * - * @param {string} policySetDefinitionName The name of the policy set - * definition to get. + * @summary Retrieve built-in policy definitions * - * @param {string} managementGroupId The ID of the management group. + * This operation retrieves a list of all the built-in policy definitions. * * @param {object} [options] Optional Parameters. * @@ -1475,19 +1901,16 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getAtManagementGroupWithHttpOperationResponse(policySetDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBuiltInWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the policy set definition at management group level. - * - * @param {string} policySetDefinitionName The name of the policy set - * definition to get. + * @summary Retrieve built-in policy definitions * - * @param {string} managementGroupId The ID of the management group. + * This operation retrieves a list of all the built-in policy definitions. * * @param {object} [options] Optional Parameters. * @@ -1501,7 +1924,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinition} - The deserialized result object. + * @resolve {PolicyDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1509,20 +1932,24 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinition} for more information. + * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, callback: ServiceCallback): void; - getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBuiltIn(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBuiltIn(callback: ServiceCallback): void; + listBuiltIn(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} managementGroupId The ID of the management group. * @@ -1533,14 +1960,17 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByManagementGroupWithHttpOperationResponse(managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByManagementGroupWithHttpOperationResponse(managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} managementGroupId The ID of the management group. * @@ -1556,7 +1986,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinitionListResult} - The deserialized result object. + * @resolve {PolicyDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1564,21 +1994,24 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinitionListResult} for more + * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinitionListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByManagementGroup(managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagementGroup(managementGroupId: string, callback: ServiceCallback): void; - listByManagementGroup(managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByManagementGroup(managementGroupId: string, callback: ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the policy set definitions for a subscription. + * @summary Retrieves policy definitions in a subscription + * + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1590,14 +2023,17 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy set definitions for a subscription. + * @summary Retrieves policy definitions in a subscription + * + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1614,7 +2050,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinitionListResult} - The deserialized result object. + * @resolve {PolicyDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1622,21 +2058,23 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinitionListResult} for more + * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinitionListResult} for more * information. * * {WebResource} [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; + 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; /** - * Gets all the built in policy set definitions. + * @summary Retrieve built-in policy definitions + * + * This operation retrieves a list of all the built-in policy definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1648,14 +2086,16 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBuiltInNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBuiltInNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the built in policy set definitions. + * @summary Retrieve built-in policy definitions + * + * This operation retrieves a list of all the built-in policy definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1672,7 +2112,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinitionListResult} - The deserialized result object. + * @resolve {PolicyDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1680,21 +2120,24 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinitionListResult} for more + * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinitionListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBuiltInNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBuiltInNext(nextPageLink: string, callback: ServiceCallback): void; - listBuiltInNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBuiltInNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBuiltInNext(nextPageLink: string, callback: ServiceCallback): void; + listBuiltInNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1706,14 +2149,17 @@ export interface PolicySetDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByManagementGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByManagementGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1730,7 +2176,7 @@ export interface PolicySetDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicySetDefinitionListResult} - The deserialized result object. + * @resolve {PolicyDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1738,55 +2184,56 @@ export interface PolicySetDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicySetDefinitionListResult} for more + * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicyDefinitionListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByManagementGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagementGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByManagementGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByManagementGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByManagementGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByManagementGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * PolicyDefinitions + * PolicySetDefinitions * __NOTE__: An instance of this class is automatically created for an * instance of the PolicyClient. */ -export interface PolicyDefinitions { +export interface PolicySetDefinitions { /** - * Creates or updates a policy definition. + * @summary Creates or updates a policy set definition. * - * @param {string} policyDefinitionName The name of the policy definition to - * create. + * This operation creates or updates a policy set definition in the given + * subscription with the given name. * - * @param {object} parameters The policy definition properties. + * @param {string} policySetDefinitionName The name of the policy set + * definition to create. + * + * @param {object} parameters The policy set definition properties. * * @param {string} [parameters.policyType] The type of policy definition. * Possible values are NotSpecified, BuiltIn, and Custom. Possible values * include: 'NotSpecified', 'BuiltIn', 'Custom' * - * @param {string} [parameters.mode] The policy definition mode. Possible - * values are NotSpecified, Indexed, and All. Possible values include: - * 'NotSpecified', 'Indexed', 'All' - * - * @param {string} [parameters.displayName] The display name of the policy + * @param {string} [parameters.displayName] The display name of the policy set * definition. * - * @param {string} [parameters.description] The policy definition description. + * @param {string} [parameters.description] The policy set definition + * description. * - * @param {object} [parameters.policyRule] The policy rule. + * @param {object} [parameters.metadata] The policy set definition metadata. * - * @param {object} [parameters.metadata] The policy definition metadata. + * @param {object} [parameters.parameters] The policy set definition parameters + * that can be used in policy definition references. * - * @param {object} [parameters.parameters] Required if a parameter is used in - * policy rule. + * @param {array} parameters.policyDefinitions An array of policy definition + * references. * * @param {object} [options] Optional Parameters. * @@ -1795,39 +2242,40 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(policyDefinitionName: string, parameters: models.PolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(policySetDefinitionName: string, parameters: models.PolicySetDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a policy definition. + * @summary Creates or updates a policy set definition. * - * @param {string} policyDefinitionName The name of the policy definition to - * create. + * This operation creates or updates a policy set definition in the given + * subscription with the given name. * - * @param {object} parameters The policy definition properties. + * @param {string} policySetDefinitionName The name of the policy set + * definition to create. + * + * @param {object} parameters The policy set definition properties. * * @param {string} [parameters.policyType] The type of policy definition. * Possible values are NotSpecified, BuiltIn, and Custom. Possible values * include: 'NotSpecified', 'BuiltIn', 'Custom' * - * @param {string} [parameters.mode] The policy definition mode. Possible - * values are NotSpecified, Indexed, and All. Possible values include: - * 'NotSpecified', 'Indexed', 'All' - * - * @param {string} [parameters.displayName] The display name of the policy + * @param {string} [parameters.displayName] The display name of the policy set * definition. * - * @param {string} [parameters.description] The policy definition description. + * @param {string} [parameters.description] The policy set definition + * description. * - * @param {object} [parameters.policyRule] The policy rule. + * @param {object} [parameters.metadata] The policy set definition metadata. * - * @param {object} [parameters.metadata] The policy definition metadata. + * @param {object} [parameters.parameters] The policy set definition parameters + * that can be used in policy definition references. * - * @param {object} [parameters.parameters] Required if a parameter is used in - * policy rule. + * @param {array} parameters.policyDefinitions An array of policy definition + * references. * * @param {object} [options] Optional Parameters. * @@ -1841,7 +2289,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinition} - The deserialized result object. + * @resolve {PolicySetDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1849,23 +2297,26 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinition} for more information. + * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinition} for more information. * * {WebResource} [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(policyDefinitionName: string, parameters: models.PolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(policyDefinitionName: string, parameters: models.PolicyDefinition, callback: ServiceCallback): void; - createOrUpdate(policyDefinitionName: string, parameters: models.PolicyDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(policySetDefinitionName: string, parameters: models.PolicySetDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(policySetDefinitionName: string, parameters: models.PolicySetDefinition, callback: ServiceCallback): void; + createOrUpdate(policySetDefinitionName: string, parameters: models.PolicySetDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a policy definition. + * @summary Deletes a policy set definition. * - * @param {string} policyDefinitionName The name of the policy definition to - * delete. + * This operation deletes the policy set definition in the given subscription + * with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to delete. * * @param {object} [options] Optional Parameters. * @@ -1878,13 +2329,16 @@ export interface PolicyDefinitions { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a policy definition. + * @summary Deletes a policy set definition. * - * @param {string} policyDefinitionName The name of the policy definition to - * delete. + * This operation deletes the policy set definition in the given subscription + * with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to delete. * * @param {object} [options] Optional Parameters. * @@ -1912,16 +2366,19 @@ export interface PolicyDefinitions { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(policyDefinitionName: string, callback: ServiceCallback): void; - deleteMethod(policyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(policySetDefinitionName: string, callback: ServiceCallback): void; + deleteMethod(policySetDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the policy definition. + * @summary Retrieves a policy set definition. * - * @param {string} policyDefinitionName The name of the policy definition to - * get. + * This operation retrieves the policy set definition in the given subscription + * with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to get. * * @param {object} [options] Optional Parameters. * @@ -1930,17 +2387,20 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the policy definition. + * @summary Retrieves a policy set definition. * - * @param {string} policyDefinitionName The name of the policy definition to - * get. + * This operation retrieves the policy set definition in the given subscription + * with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to get. * * @param {object} [options] Optional Parameters. * @@ -1954,7 +2414,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinition} - The deserialized result object. + * @resolve {PolicySetDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1962,22 +2422,25 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinition} for more information. + * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinition} for more information. * * {WebResource} [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(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(policyDefinitionName: string, callback: ServiceCallback): void; - get(policyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(policySetDefinitionName: string, callback: ServiceCallback): void; + get(policySetDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the built in policy definition. + * @summary Retrieves a built in policy set definition. * - * @param {string} policyDefinitionName The name of the built in policy + * This operation retrieves the built-in policy set definition with the given + * name. + * + * @param {string} policySetDefinitionName The name of the policy set * definition to get. * * @param {object} [options] Optional Parameters. @@ -1987,16 +2450,19 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getBuiltInWithHttpOperationResponse(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getBuiltInWithHttpOperationResponse(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the built in policy definition. + * @summary Retrieves a built in policy set definition. * - * @param {string} policyDefinitionName The name of the built in policy + * This operation retrieves the built-in policy set definition with the given + * name. + * + * @param {string} policySetDefinitionName The name of the policy set * definition to get. * * @param {object} [options] Optional Parameters. @@ -2011,7 +2477,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinition} - The deserialized result object. + * @resolve {PolicySetDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2019,47 +2485,23 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinition} for more information. + * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinition} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getBuiltIn(policyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBuiltIn(policyDefinitionName: string, callback: ServiceCallback): void; - getBuiltIn(policyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getBuiltIn(policySetDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBuiltIn(policySetDefinitionName: string, callback: ServiceCallback): void; + getBuiltIn(policySetDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a policy definition at management group level. - * - * @param {string} policyDefinitionName The name of the policy definition to - * create. - * - * @param {object} parameters The policy definition properties. - * - * @param {string} [parameters.policyType] The type of policy definition. - * Possible values are NotSpecified, BuiltIn, and Custom. Possible values - * include: 'NotSpecified', 'BuiltIn', 'Custom' - * - * @param {string} [parameters.mode] The policy definition mode. Possible - * values are NotSpecified, Indexed, and All. Possible values include: - * 'NotSpecified', 'Indexed', 'All' - * - * @param {string} [parameters.displayName] The display name of the policy - * definition. - * - * @param {string} [parameters.description] The policy definition description. - * - * @param {object} [parameters.policyRule] The policy rule. - * - * @param {object} [parameters.metadata] The policy definition metadata. - * - * @param {object} [parameters.parameters] Required if a parameter is used in - * policy rule. + * @summary Retrieves the policy set definitions for a subscription. * - * @param {string} managementGroupId The ID of the management group. + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {object} [options] Optional Parameters. * @@ -2068,41 +2510,17 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateAtManagementGroupWithHttpOperationResponse(policyDefinitionName: string, parameters: models.PolicyDefinition, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a policy definition at management group level. + * @summary Retrieves the policy set definitions for a subscription. * - * @param {string} policyDefinitionName The name of the policy definition to - * create. - * - * @param {object} parameters The policy definition properties. - * - * @param {string} [parameters.policyType] The type of policy definition. - * Possible values are NotSpecified, BuiltIn, and Custom. Possible values - * include: 'NotSpecified', 'BuiltIn', 'Custom' - * - * @param {string} [parameters.mode] The policy definition mode. Possible - * values are NotSpecified, Indexed, and All. Possible values include: - * 'NotSpecified', 'Indexed', 'All' - * - * @param {string} [parameters.displayName] The display name of the policy - * definition. - * - * @param {string} [parameters.description] The policy definition description. - * - * @param {object} [parameters.policyRule] The policy rule. - * - * @param {object} [parameters.metadata] The policy definition metadata. - * - * @param {object} [parameters.parameters] Required if a parameter is used in - * policy rule. - * - * @param {string} managementGroupId The ID of the management group. + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {object} [options] Optional Parameters. * @@ -2116,7 +2534,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinition} - The deserialized result object. + * @resolve {PolicySetDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2124,25 +2542,23 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinition} for more information. + * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: models.PolicyDefinition, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: models.PolicyDefinition, managementGroupId: string, callback: ServiceCallback): void; - createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: models.PolicyDefinition, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a policy definition at management group level. + * @summary Retrieves built-in policy set definitions. * - * @param {string} policyDefinitionName The name of the policy definition to - * delete. - * - * @param {string} managementGroupId The ID of the management group. + * This operation retrieves a list of all the built-in policy set definitions. * * @param {object} [options] Optional Parameters. * @@ -2151,19 +2567,16 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteAtManagementGroupWithHttpOperationResponse(policyDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBuiltInWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a policy definition at management group level. + * @summary Retrieves built-in policy set definitions. * - * @param {string} policyDefinitionName The name of the policy definition to - * delete. - * - * @param {string} managementGroupId The ID of the management group. + * This operation retrieves a list of all the built-in policy set definitions. * * @param {object} [options] Optional Parameters. * @@ -2177,7 +2590,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PolicySetDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2185,22 +2598,47 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, callback: ServiceCallback): void; - deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBuiltIn(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBuiltIn(callback: ServiceCallback): void; + listBuiltIn(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the policy definition at management group level. + * @summary Creates or updates a policy set definition. * - * @param {string} policyDefinitionName The name of the policy definition to - * get. + * This operation creates or updates a policy set definition in the given + * management group with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to create. + * + * @param {object} parameters The policy set definition properties. + * + * @param {string} [parameters.policyType] The type of policy definition. + * Possible values are NotSpecified, BuiltIn, and Custom. Possible values + * include: 'NotSpecified', 'BuiltIn', 'Custom' + * + * @param {string} [parameters.displayName] The display name of the policy set + * definition. + * + * @param {string} [parameters.description] The policy set definition + * description. + * + * @param {object} [parameters.metadata] The policy set definition metadata. + * + * @param {object} [parameters.parameters] The policy set definition parameters + * that can be used in policy definition references. + * + * @param {array} parameters.policyDefinitions An array of policy definition + * references. * * @param {string} managementGroupId The ID of the management group. * @@ -2211,17 +2649,40 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getAtManagementGroupWithHttpOperationResponse(policyDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateAtManagementGroupWithHttpOperationResponse(policySetDefinitionName: string, parameters: models.PolicySetDefinition, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the policy definition at management group level. + * @summary Creates or updates a policy set definition. * - * @param {string} policyDefinitionName The name of the policy definition to - * get. + * This operation creates or updates a policy set definition in the given + * management group with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to create. + * + * @param {object} parameters The policy set definition properties. + * + * @param {string} [parameters.policyType] The type of policy definition. + * Possible values are NotSpecified, BuiltIn, and Custom. Possible values + * include: 'NotSpecified', 'BuiltIn', 'Custom' + * + * @param {string} [parameters.displayName] The display name of the policy set + * definition. + * + * @param {string} [parameters.description] The policy set definition + * description. + * + * @param {object} [parameters.metadata] The policy set definition metadata. + * + * @param {object} [parameters.parameters] The policy set definition parameters + * that can be used in policy definition references. + * + * @param {array} parameters.policyDefinitions An array of policy definition + * references. * * @param {string} managementGroupId The ID of the management group. * @@ -2237,7 +2698,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinition} - The deserialized result object. + * @resolve {PolicySetDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2245,20 +2706,28 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinition} for more information. + * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinition} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, callback: ServiceCallback): void; - getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: models.PolicySetDefinition, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: models.PolicySetDefinition, managementGroupId: string, callback: ServiceCallback): void; + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: models.PolicySetDefinition, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the policy definitions for a subscription. + * @summary Deletes a policy set definition. + * + * This operation deletes the policy set definition in the given management + * group with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to delete. + * + * @param {string} managementGroupId The ID of the management group. * * @param {object} [options] Optional Parameters. * @@ -2267,14 +2736,22 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteAtManagementGroupWithHttpOperationResponse(policySetDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy definitions for a subscription. + * @summary Deletes a policy set definition. + * + * This operation deletes the policy set definition in the given management + * group with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to delete. + * + * @param {string} managementGroupId The ID of the management group. * * @param {object} [options] Optional Parameters. * @@ -2288,7 +2765,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinitionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2296,21 +2773,27 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinitionListResult} for more - * information. + * {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. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, callback: ServiceCallback): void; + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the built in policy definitions. + * @summary Retrieves a policy set definition. + * + * This operation retrieves the policy set definition in the given management + * group with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to get. + * + * @param {string} managementGroupId The ID of the management group. * * @param {object} [options] Optional Parameters. * @@ -2319,14 +2802,22 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBuiltInWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getAtManagementGroupWithHttpOperationResponse(policySetDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the built in policy definitions. + * @summary Retrieves a policy set definition. + * + * This operation retrieves the policy set definition in the given management + * group with the given name. + * + * @param {string} policySetDefinitionName The name of the policy set + * definition to get. + * + * @param {string} managementGroupId The ID of the management group. * * @param {object} [options] Optional Parameters. * @@ -2340,7 +2831,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinitionListResult} - The deserialized result object. + * @resolve {PolicySetDefinition} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2348,22 +2839,23 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinitionListResult} for more - * information. + * {PolicySetDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinition} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBuiltIn(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBuiltIn(callback: ServiceCallback): void; - listBuiltIn(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, callback: ServiceCallback): void; + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} managementGroupId The ID of the management group. * @@ -2374,15 +2866,17 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByManagementGroupWithHttpOperationResponse(managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByManagementGroupWithHttpOperationResponse(managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} managementGroupId The ID of the management group. * @@ -2398,7 +2892,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinitionListResult} - The deserialized result object. + * @resolve {PolicySetDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2406,21 +2900,24 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinitionListResult} for more + * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinitionListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByManagementGroup(managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagementGroup(managementGroupId: string, callback: ServiceCallback): void; - listByManagementGroup(managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByManagementGroup(managementGroupId: string, callback: ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the policy definitions for a subscription. + * @summary Retrieves the policy set definitions for a subscription. + * + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2432,14 +2929,17 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy definitions for a subscription. + * @summary Retrieves the policy set definitions for a subscription. + * + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2456,7 +2956,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinitionListResult} - The deserialized result object. + * @resolve {PolicySetDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2464,21 +2964,23 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinitionListResult} for more + * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinitionListResult} for more * information. * * {WebResource} [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; + 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; /** - * Gets all the built in policy definitions. + * @summary Retrieves built-in policy set definitions. + * + * This operation retrieves a list of all the built-in policy set definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2490,14 +2992,16 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBuiltInNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBuiltInNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the built in policy definitions. + * @summary Retrieves built-in policy set definitions. + * + * This operation retrieves a list of all the built-in policy set definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2514,7 +3018,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinitionListResult} - The deserialized result object. + * @resolve {PolicySetDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2522,22 +3026,24 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinitionListResult} for more + * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinitionListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBuiltInNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBuiltInNext(nextPageLink: string, callback: ServiceCallback): void; - listBuiltInNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBuiltInNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBuiltInNext(nextPageLink: string, callback: ServiceCallback): void; + listBuiltInNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2549,15 +3055,17 @@ export interface PolicyDefinitions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByManagementGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByManagementGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2574,7 +3082,7 @@ export interface PolicyDefinitions { * * {Promise} A promise is returned. * - * @resolve {PolicyDefinitionListResult} - The deserialized result object. + * @resolve {PolicySetDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2582,15 +3090,15 @@ export interface PolicyDefinitions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PolicyDefinitionListResult} for more + * {PolicySetDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link PolicySetDefinitionListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByManagementGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagementGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByManagementGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByManagementGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByManagementGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByManagementGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/resourceManagement/lib/policy/operations/index.js b/lib/services/resourceManagement/lib/policy/operations/index.js index d60397f3b6..8d6fdd7a3d 100644 --- a/lib/services/resourceManagement/lib/policy/operations/index.js +++ b/lib/services/resourceManagement/lib/policy/operations/index.js @@ -15,5 +15,5 @@ 'use strict'; exports.PolicyAssignments = require('./policyAssignments'); -exports.PolicySetDefinitions = require('./policySetDefinitions'); exports.PolicyDefinitions = require('./policyDefinitions'); +exports.PolicySetDefinitions = require('./policySetDefinitions'); diff --git a/lib/services/resourceManagement/lib/policy/operations/policyAssignments.js b/lib/services/resourceManagement/lib/policy/operations/policyAssignments.js index e5dbd55ea2..6bc775696d 100644 --- a/lib/services/resourceManagement/lib/policy/operations/policyAssignments.js +++ b/lib/services/resourceManagement/lib/policy/operations/policyAssignments.js @@ -15,9 +15,21 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Deletes a policy assignment. - * - * @param {string} scope The scope of the policy assignment. + * @summary Deletes a policy assignment. + * + * This operation deletes a policy assignment, given its name and the scope it + * was created in. The scope of a policy assignment is the part of its ID + * preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * delete. @@ -50,7 +62,6 @@ function _deleteMethod(scope, policyAssignmentName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -59,6 +70,9 @@ function _deleteMethod(scope, policyAssignmentName, options, callback) { if (policyAssignmentName === null || policyAssignmentName === undefined || typeof policyAssignmentName.valueOf() !== 'string') { throw new Error('policyAssignmentName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -72,7 +86,7 @@ function _deleteMethod(scope, policyAssignmentName, options, callback) { requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{policyAssignmentName}', encodeURIComponent(policyAssignmentName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -156,13 +170,21 @@ function _deleteMethod(scope, policyAssignmentName, options, callback) { } /** - * @summary Creates a policy assignment. - * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. - * - * @param {string} scope The scope of the policy assignment. + * @summary Creates or updates a policy assignment. + * + * This operation creates or updates a policy assignment with the given scope + * and name. Policy assignments apply to all resources contained within their + * scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment. * @@ -172,7 +194,7 @@ function _deleteMethod(scope, policyAssignmentName, options, callback) { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -186,7 +208,8 @@ function _deleteMethod(scope, policyAssignmentName, options, callback) { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -194,6 +217,15 @@ function _deleteMethod(scope, policyAssignmentName, options, callback) { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -222,7 +254,6 @@ function _create(scope, policyAssignmentName, parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -234,6 +265,9 @@ function _create(scope, policyAssignmentName, parameters, options, callback) { if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -247,7 +281,7 @@ function _create(scope, policyAssignmentName, parameters, options, callback) { requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{policyAssignmentName}', encodeURIComponent(policyAssignmentName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -345,9 +379,19 @@ function _create(scope, policyAssignmentName, parameters, options, callback) { } /** - * Gets a policy assignment. + * @summary Retrieves a policy assignment. + * + * This operation retrieves a single policy assignment, given its name and the + * scope it was created at. * - * @param {string} scope The scope of the policy assignment. + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * get. @@ -380,7 +424,6 @@ function _get(scope, policyAssignmentName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (scope === null || scope === undefined || typeof scope.valueOf() !== 'string') { @@ -389,6 +432,9 @@ function _get(scope, policyAssignmentName, options, callback) { if (policyAssignmentName === null || policyAssignmentName === undefined || typeof policyAssignmentName.valueOf() !== 'string') { throw new Error('policyAssignmentName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -402,7 +448,7 @@ function _get(scope, policyAssignmentName, options, callback) { requestUrl = requestUrl.replace('{scope}', scope); requestUrl = requestUrl.replace('{policyAssignmentName}', encodeURIComponent(policyAssignmentName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -486,14 +532,30 @@ function _get(scope, policyAssignmentName, options, callback) { } /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} resourceGroupName The name of the resource group that * contains policy assignments. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -523,7 +585,6 @@ function _listForResourceGroup(resourceGroupName, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2017-06-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -546,6 +607,9 @@ function _listForResourceGroup(resourceGroupName, options, callback) { if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -565,7 +629,7 @@ function _listForResourceGroup(resourceGroupName, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -649,24 +713,56 @@ function _listForResourceGroup(resourceGroupName, options, callback) { } /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} resourceGroupName The name of the resource group containing - * the resource. The name is case insensitive. + * the resource. * * @param {string} resourceProviderNamespace The namespace of the resource - * provider. + * provider. For example, the namespace of a virtual machine is + * Microsoft.Compute (from Microsoft.Compute/virtualMachines) * - * @param {string} parentResourcePath The parent resource path. + * @param {string} parentResourcePath The parent resource path. Use empty + * string if there is none. * - * @param {string} resourceType The resource type. + * @param {string} resourceType The resource type name. For example the type + * name of a web app is 'sites' (from Microsoft.Web/sites). * - * @param {string} resourceName The name of the resource with policy - * assignments. + * @param {string} resourceName The name of the resource. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -696,7 +792,6 @@ function _listForResource(resourceGroupName, resourceProviderNamespace, parentRe throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2017-06-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -731,6 +826,9 @@ function _listForResource(resourceGroupName, resourceProviderNamespace, parentRe if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -754,7 +852,7 @@ function _listForResource(resourceGroupName, resourceProviderNamespace, parentRe if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -838,11 +936,27 @@ function _listForResource(resourceGroupName, resourceProviderNamespace, parentRe } /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -872,12 +986,14 @@ function _list(options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2017-06-01-preview'; // Validate try { if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -896,7 +1012,7 @@ function _list(options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -980,18 +1096,22 @@ function _list(options, callback) { } /** - * @summary Deletes a policy assignment by ID. - * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Deletes a policy assignment. + * + * This operation deletes the policy with the given ID. Policy assignment IDs + * have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid formats for {scope} are: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}' + * (management group), '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + * (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * * @param {string} policyAssignmentId The ID of the policy assignment to * delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -1021,12 +1141,14 @@ function _deleteById(policyAssignmentId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policyAssignmentId === null || policyAssignmentId === undefined || typeof policyAssignmentId.valueOf() !== 'string') { throw new Error('policyAssignmentId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1039,7 +1161,7 @@ function _deleteById(policyAssignmentId, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{policyAssignmentId}'; requestUrl = requestUrl.replace('{policyAssignmentId}', policyAssignmentId); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1071,7 +1193,7 @@ function _deleteById(policyAssignmentId, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1123,20 +1245,25 @@ function _deleteById(policyAssignmentId, options, callback) { } /** - * @summary Creates a policy assignment by ID. - * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Creates or updates a policy assignment. + * + * This operation creates or updates the policy assignment with the given ID. + * Policy assignments made on a scope apply to all resources contained in that + * scope. For example, when you assign a policy to a resource group that policy + * applies to all resources in the group. Policy assignment IDs have this + * format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to * create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} parameters Parameters for policy assignment. * @@ -1144,7 +1271,7 @@ function _deleteById(policyAssignmentId, options, callback) { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -1158,7 +1285,8 @@ function _deleteById(policyAssignmentId, options, callback) { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -1166,6 +1294,15 @@ function _deleteById(policyAssignmentId, options, callback) { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1194,7 +1331,6 @@ function _createById(policyAssignmentId, parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policyAssignmentId === null || policyAssignmentId === undefined || typeof policyAssignmentId.valueOf() !== 'string') { @@ -1203,6 +1339,9 @@ function _createById(policyAssignmentId, parameters, options, callback) { if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1215,7 +1354,7 @@ function _createById(policyAssignmentId, parameters, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{policyAssignmentId}'; requestUrl = requestUrl.replace('{policyAssignmentId}', policyAssignmentId); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1313,18 +1452,22 @@ function _createById(policyAssignmentId, parameters, options, callback) { } /** - * @summary Gets a policy assignment by ID. - * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Retrieves the policy assignment with the given ID. + * + * The operation retrieves the policy assignment with the given ID. Policy + * assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to get. * Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -1354,12 +1497,14 @@ function _getById(policyAssignmentId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policyAssignmentId === null || policyAssignmentId === undefined || typeof policyAssignmentId.valueOf() !== 'string') { throw new Error('policyAssignmentId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1372,7 +1517,7 @@ function _getById(policyAssignmentId, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{policyAssignmentId}'; requestUrl = requestUrl.replace('{policyAssignmentId}', policyAssignmentId); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1456,7 +1601,21 @@ function _getById(policyAssignmentId, options, callback) { } /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1585,7 +1744,35 @@ function _listForResourceGroupNext(nextPageLink, options, callback) { } /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1714,7 +1901,21 @@ function _listForResourceNext(nextPageLink, options, callback) { } /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1865,9 +2066,21 @@ class PolicyAssignments { } /** - * Deletes a policy assignment. - * - * @param {string} scope The scope of the policy assignment. + * @summary Deletes a policy assignment. + * + * This operation deletes a policy assignment, given its name and the scope it + * was created in. The scope of a policy assignment is the part of its ID + * preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * delete. @@ -1898,9 +2111,21 @@ class PolicyAssignments { } /** - * Deletes a policy assignment. - * - * @param {string} scope The scope of the policy assignment. + * @summary Deletes a policy assignment. + * + * This operation deletes a policy assignment, given its name and the scope it + * was created in. The scope of a policy assignment is the part of its ID + * preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * delete. @@ -1953,13 +2178,21 @@ class PolicyAssignments { } /** - * @summary Creates a policy assignment. - * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. - * - * @param {string} scope The scope of the policy assignment. + * @summary Creates or updates a policy assignment. + * + * This operation creates or updates a policy assignment with the given scope + * and name. Policy assignments apply to all resources contained within their + * scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment. * @@ -1969,7 +2202,7 @@ class PolicyAssignments { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -1983,7 +2216,8 @@ class PolicyAssignments { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -1991,6 +2225,15 @@ class PolicyAssignments { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2017,13 +2260,21 @@ class PolicyAssignments { } /** - * @summary Creates a policy assignment. - * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. - * - * @param {string} scope The scope of the policy assignment. + * @summary Creates or updates a policy assignment. + * + * This operation creates or updates a policy assignment with the given scope + * and name. Policy assignments apply to all resources contained within their + * scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment. * @@ -2033,7 +2284,7 @@ class PolicyAssignments { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -2047,7 +2298,8 @@ class PolicyAssignments { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -2055,6 +2307,15 @@ class PolicyAssignments { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2103,9 +2364,19 @@ class PolicyAssignments { } /** - * Gets a policy assignment. + * @summary Retrieves a policy assignment. + * + * This operation retrieves a single policy assignment, given its name and the + * scope it was created at. * - * @param {string} scope The scope of the policy assignment. + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * get. @@ -2136,9 +2407,19 @@ class PolicyAssignments { } /** - * Gets a policy assignment. + * @summary Retrieves a policy assignment. + * + * This operation retrieves a single policy assignment, given its name and the + * scope it was created at. * - * @param {string} scope The scope of the policy assignment. + * @param {string} scope The scope of the policy assignment. Valid scopes are: + * management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * * @param {string} policyAssignmentName The name of the policy assignment to * get. @@ -2191,14 +2472,30 @@ class PolicyAssignments { } /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} resourceGroupName The name of the resource group that * contains policy assignments. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2224,14 +2521,30 @@ class PolicyAssignments { } /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} resourceGroupName The name of the resource group that * contains policy assignments. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2280,24 +2593,56 @@ class PolicyAssignments { } /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} resourceGroupName The name of the resource group containing - * the resource. The name is case insensitive. + * the resource. * * @param {string} resourceProviderNamespace The namespace of the resource - * provider. + * provider. For example, the namespace of a virtual machine is + * Microsoft.Compute (from Microsoft.Compute/virtualMachines) * - * @param {string} parentResourcePath The parent resource path. + * @param {string} parentResourcePath The parent resource path. Use empty + * string if there is none. * - * @param {string} resourceType The resource type. + * @param {string} resourceType The resource type name. For example the type + * name of a web app is 'sites' (from Microsoft.Web/sites). * - * @param {string} resourceName The name of the resource with policy - * assignments. + * @param {string} resourceName The name of the resource. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2323,24 +2668,56 @@ class PolicyAssignments { } /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} resourceGroupName The name of the resource group containing - * the resource. The name is case insensitive. + * the resource. * * @param {string} resourceProviderNamespace The namespace of the resource - * provider. + * provider. For example, the namespace of a virtual machine is + * Microsoft.Compute (from Microsoft.Compute/virtualMachines) * - * @param {string} parentResourcePath The parent resource path. + * @param {string} parentResourcePath The parent resource path. Use empty + * string if there is none. * - * @param {string} resourceType The resource type. + * @param {string} resourceType The resource type name. For example the type + * name of a web app is 'sites' (from Microsoft.Web/sites). * - * @param {string} resourceName The name of the resource with policy - * assignments. + * @param {string} resourceName The name of the resource. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2389,11 +2766,27 @@ class PolicyAssignments { } /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2419,11 +2812,27 @@ class PolicyAssignments { } /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} [options.filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, no filtering is performed. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2472,18 +2881,22 @@ class PolicyAssignments { } /** - * @summary Deletes a policy assignment by ID. - * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Deletes a policy assignment. + * + * This operation deletes the policy with the given ID. Policy assignment IDs + * have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid formats for {scope} are: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}' + * (management group), '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + * (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * * @param {string} policyAssignmentId The ID of the policy assignment to * delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -2511,18 +2924,22 @@ class PolicyAssignments { } /** - * @summary Deletes a policy assignment by ID. - * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Deletes a policy assignment. + * + * This operation deletes the policy with the given ID. Policy assignment IDs + * have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid formats for {scope} are: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}' + * (management group), '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + * (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * * @param {string} policyAssignmentId The ID of the policy assignment to * delete. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -2572,20 +2989,25 @@ class PolicyAssignments { } /** - * @summary Creates a policy assignment by ID. - * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Creates or updates a policy assignment. + * + * This operation creates or updates the policy assignment with the given ID. + * Policy assignments made on a scope apply to all resources contained in that + * scope. For example, when you assign a policy to a resource group that policy + * applies to all resources in the group. Policy assignment IDs have this + * format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to * create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} parameters Parameters for policy assignment. * @@ -2593,7 +3015,7 @@ class PolicyAssignments { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -2607,7 +3029,8 @@ class PolicyAssignments { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -2615,6 +3038,15 @@ class PolicyAssignments { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2641,20 +3073,25 @@ class PolicyAssignments { } /** - * @summary Creates a policy assignment by ID. - * - * Policy assignments are inherited by child resources. For example, when you - * apply a policy to a resource group that policy is assigned to all resources - * in the group. When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Creates or updates a policy assignment. + * + * This operation creates or updates the policy assignment with the given ID. + * Policy assignments made on a scope apply to all resources contained in that + * scope. For example, when you assign a policy to a resource group that policy + * applies to all resources in the group. Policy assignment IDs have this + * format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to * create. Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} parameters Parameters for policy assignment. * @@ -2662,7 +3099,7 @@ class PolicyAssignments { * assignment. * * @param {string} [parameters.policyDefinitionId] The ID of the policy - * definition. + * definition or policy set definition being assigned. * * @param {string} [parameters.scope] The scope for the policy assignment. * @@ -2676,7 +3113,8 @@ class PolicyAssignments { * * @param {object} [parameters.metadata] The policy assignment metadata. * - * @param {object} [parameters.sku] The policy sku. + * @param {object} [parameters.sku] The policy sku. This property is optional, + * obsolete, and will be ignored. * * @param {string} parameters.sku.name The name of the policy sku. Possible * values are A0 and A1. @@ -2684,6 +3122,15 @@ class PolicyAssignments { * @param {string} [parameters.sku.tier] The policy sku tier. Possible values * are Free and Standard. * + * @param {string} [parameters.location] The location of the policy assignment. + * Only required when utilizing managed identity. + * + * @param {object} [parameters.identity] The managed identity associated with + * the policy assignment. + * + * @param {string} [parameters.identity.type] The identity type. Possible + * values include: 'SystemAssigned', 'None' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2732,18 +3179,22 @@ class PolicyAssignments { } /** - * @summary Gets a policy assignment by ID. - * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Retrieves the policy assignment with the given ID. + * + * The operation retrieves the policy assignment with the given ID. Policy + * assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to get. * Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -2771,18 +3222,22 @@ class PolicyAssignments { } /** - * @summary Gets a policy assignment by ID. - * - * When providing a scope for the assigment, use - * '/subscriptions/{subscription-id}/' for subscriptions, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for - * resource groups, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' - * for resources. + * @summary Retrieves the policy assignment with the given ID. + * + * The operation retrieves the policy assignment with the given ID. Policy + * assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + * subscription (format: '/subscriptions/{subscriptionId}'), resource group + * (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or + * resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * * @param {string} policyAssignmentId The ID of the policy assignment to get. * Use the format - * '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * * @param {object} [options] Optional Parameters. * @@ -2832,7 +3287,21 @@ class PolicyAssignments { } /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2863,7 +3332,21 @@ class PolicyAssignments { } /** - * Gets policy assignments for the resource group. + * @summary Retrieves all policy assignments that apply to a resource group. + * + * This operation retrieves the list of all policy assignments associated with + * the given resource group in the given subscription that match the optional + * given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, + * as well as any applied to resources contained within the resource group. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource group. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * group and assign the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2917,7 +3400,35 @@ class PolicyAssignments { } /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2948,7 +3459,35 @@ class PolicyAssignments { } /** - * Gets policy assignments for a resource. + * @summary Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with + * the specified resource in the given resource group and subscription that + * match the optional given $filter. Valid values for $filter are: 'atScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the + * resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If + * $filter=atScope() is provided, the returned list includes all policy + * assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the + * resource. If $filter=policyDefinitionId eq '{value}' is provided, the + * returned list includes only policy assignments that apply to the resource + * and assign the policy definition whose id is {value}. Three parameters plus + * the resource name are used to identify a specific resource. If the resource + * is not part of a parent resource (the more common case), the parent resource + * path should not be provided (or provided as ''). For example a web app could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Web', + * {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == + * 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', + * {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} + * == 'domainNames', {resourceName} == 'MyComputerName'). A convenient + * alternative to providing the namespace and type name separately is to + * provide both in the {resourceType} parameter, format: + * ({resourceProviderNamespace} == '', {parentResourcePath} == '', + * {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3002,7 +3541,21 @@ class PolicyAssignments { } /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3033,7 +3586,21 @@ class PolicyAssignments { } /** - * Gets all the policy assignments for a subscription. + * @summary Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with + * the given subscription that match the optional given $filter. Valid values + * for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If + * $filter is not provided, the unfiltered list includes all policy assignments + * associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription, as well as any + * applied to objects contained within the subscription. If $filter=atScope() + * is provided, the returned list includes all policy assignments that apply to + * the subscription, which is everything in the unfiltered list except those + * applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list + * includes only policy assignments that apply to the subscription and assign + * the policy definition whose id is {value}. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/resourceManagement/lib/policy/operations/policyDefinitions.js b/lib/services/resourceManagement/lib/policy/operations/policyDefinitions.js index 889177fc7e..f032586168 100644 --- a/lib/services/resourceManagement/lib/policy/operations/policyDefinitions.js +++ b/lib/services/resourceManagement/lib/policy/operations/policyDefinitions.js @@ -15,7 +15,10 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Creates or updates a policy definition. + * @summary Creates or updates a policy definition in a subscription. + * + * This operation creates or updates a policy definition in the given + * subscription with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * create. @@ -70,7 +73,6 @@ function _createOrUpdate(policyDefinitionName, parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // Validate try { if (policyDefinitionName === null || policyDefinitionName === undefined || typeof policyDefinitionName.valueOf() !== 'string') { @@ -79,6 +81,9 @@ function _createOrUpdate(policyDefinitionName, parameters, options, callback) { if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -95,7 +100,7 @@ function _createOrUpdate(policyDefinitionName, parameters, options, callback) { requestUrl = requestUrl.replace('{policyDefinitionName}', encodeURIComponent(policyDefinitionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -192,7 +197,10 @@ function _createOrUpdate(policyDefinitionName, parameters, options, callback) { } /** - * Deletes a policy definition. + * @summary Deletes a policy definition in a subscription. + * + * This operation deletes the policy definition in the given subscription with + * the given name. * * @param {string} policyDefinitionName The name of the policy definition to * delete. @@ -224,12 +232,14 @@ function _deleteMethod(policyDefinitionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // Validate try { if (policyDefinitionName === null || policyDefinitionName === undefined || typeof policyDefinitionName.valueOf() !== 'string') { throw new Error('policyDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -246,7 +256,7 @@ function _deleteMethod(policyDefinitionName, options, callback) { requestUrl = requestUrl.replace('{policyDefinitionName}', encodeURIComponent(policyDefinitionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -312,7 +322,10 @@ function _deleteMethod(policyDefinitionName, options, callback) { } /** - * Gets the policy definition. + * @summary Retrieves a policy definition in a subscription. + * + * This operation retrieves the policy definition in the given subscription + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * get. @@ -345,12 +358,14 @@ function _get(policyDefinitionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // Validate try { if (policyDefinitionName === null || policyDefinitionName === undefined || typeof policyDefinitionName.valueOf() !== 'string') { throw new Error('policyDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -367,7 +382,7 @@ function _get(policyDefinitionName, options, callback) { requestUrl = requestUrl.replace('{policyDefinitionName}', encodeURIComponent(policyDefinitionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -450,9 +465,11 @@ function _get(policyDefinitionName, options, callback) { } /** - * Gets the built in policy definition. + * @summary Retrieves a built-in policy definition. + * + * This operation retrieves the built-in policy definition with the given name. * - * @param {string} policyDefinitionName The name of the built in policy + * @param {string} policyDefinitionName The name of the built-in policy * definition to get. * * @param {object} [options] Optional Parameters. @@ -483,12 +500,14 @@ function _getBuiltIn(policyDefinitionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // Validate try { if (policyDefinitionName === null || policyDefinitionName === undefined || typeof policyDefinitionName.valueOf() !== 'string') { throw new Error('policyDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -501,7 +520,7 @@ function _getBuiltIn(policyDefinitionName, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}'; requestUrl = requestUrl.replace('{policyDefinitionName}', encodeURIComponent(policyDefinitionName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -584,7 +603,10 @@ function _getBuiltIn(policyDefinitionName, options, callback) { } /** - * Creates or updates a policy definition at management group level. + * @summary Creates or updates a policy definition in a management group. + * + * This operation creates or updates a policy definition in the given + * management group with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * create. @@ -641,7 +663,6 @@ function _createOrUpdateAtManagementGroup(policyDefinitionName, parameters, mana if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // Validate try { if (policyDefinitionName === null || policyDefinitionName === undefined || typeof policyDefinitionName.valueOf() !== 'string') { @@ -650,6 +671,9 @@ function _createOrUpdateAtManagementGroup(policyDefinitionName, parameters, mana if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (managementGroupId === null || managementGroupId === undefined || typeof managementGroupId.valueOf() !== 'string') { throw new Error('managementGroupId cannot be null or undefined and it must be of type string.'); } @@ -666,7 +690,7 @@ function _createOrUpdateAtManagementGroup(policyDefinitionName, parameters, mana requestUrl = requestUrl.replace('{policyDefinitionName}', encodeURIComponent(policyDefinitionName)); requestUrl = requestUrl.replace('{managementGroupId}', encodeURIComponent(managementGroupId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -763,7 +787,10 @@ function _createOrUpdateAtManagementGroup(policyDefinitionName, parameters, mana } /** - * Deletes a policy definition at management group level. + * @summary Deletes a policy definition in a management group. + * + * This operation deletes the policy definition in the given management group + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * delete. @@ -797,12 +824,14 @@ function _deleteAtManagementGroup(policyDefinitionName, managementGroupId, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // Validate try { if (policyDefinitionName === null || policyDefinitionName === undefined || typeof policyDefinitionName.valueOf() !== 'string') { throw new Error('policyDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (managementGroupId === null || managementGroupId === undefined || typeof managementGroupId.valueOf() !== 'string') { throw new Error('managementGroupId cannot be null or undefined and it must be of type string.'); } @@ -819,7 +848,7 @@ function _deleteAtManagementGroup(policyDefinitionName, managementGroupId, optio requestUrl = requestUrl.replace('{policyDefinitionName}', encodeURIComponent(policyDefinitionName)); requestUrl = requestUrl.replace('{managementGroupId}', encodeURIComponent(managementGroupId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -885,7 +914,10 @@ function _deleteAtManagementGroup(policyDefinitionName, managementGroupId, optio } /** - * Gets the policy definition at management group level. + * @summary Retrieve a policy definition in a management group. + * + * This operation retrieves the policy definition in the given management group + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * get. @@ -920,12 +952,14 @@ function _getAtManagementGroup(policyDefinitionName, managementGroupId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // Validate try { if (policyDefinitionName === null || policyDefinitionName === undefined || typeof policyDefinitionName.valueOf() !== 'string') { throw new Error('policyDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (managementGroupId === null || managementGroupId === undefined || typeof managementGroupId.valueOf() !== 'string') { throw new Error('managementGroupId cannot be null or undefined and it must be of type string.'); } @@ -942,7 +976,7 @@ function _getAtManagementGroup(policyDefinitionName, managementGroupId, options, requestUrl = requestUrl.replace('{policyDefinitionName}', encodeURIComponent(policyDefinitionName)); requestUrl = requestUrl.replace('{managementGroupId}', encodeURIComponent(managementGroupId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1025,7 +1059,10 @@ function _getAtManagementGroup(policyDefinitionName, managementGroupId, options, } /** - * Gets all the policy definitions for a subscription. + * @summary Retrieves policy definitions in a subscription + * + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {object} [options] Optional Parameters. * @@ -1056,9 +1093,11 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1074,7 +1113,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1157,7 +1196,9 @@ function _list(options, callback) { } /** - * Gets all the built in policy definitions. + * @summary Retrieve built-in policy definitions + * + * This operation retrieves a list of all the built-in policy definitions. * * @param {object} [options] Optional Parameters. * @@ -1188,9 +1229,11 @@ function _listBuiltIn(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // 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.'); } @@ -1202,7 +1245,7 @@ function _listBuiltIn(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Authorization/policyDefinitions'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1285,8 +1328,10 @@ function _listBuiltIn(options, callback) { } /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} managementGroupId The ID of the management group. * @@ -1319,9 +1364,11 @@ function _listByManagementGroup(managementGroupId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-12-01'; // 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 (managementGroupId === null || managementGroupId === undefined || typeof managementGroupId.valueOf() !== 'string') { throw new Error('managementGroupId cannot be null or undefined and it must be of type string.'); } @@ -1337,7 +1384,7 @@ function _listByManagementGroup(managementGroupId, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions'; requestUrl = requestUrl.replace('{managementGroupId}', encodeURIComponent(managementGroupId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1420,7 +1467,10 @@ function _listByManagementGroup(managementGroupId, options, callback) { } /** - * Gets all the policy definitions for a subscription. + * @summary Retrieves policy definitions in a subscription + * + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1548,7 +1598,9 @@ function _listNext(nextPageLink, options, callback) { } /** - * Gets all the built in policy definitions. + * @summary Retrieve built-in policy definitions + * + * This operation retrieves a list of all the built-in policy definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1676,8 +1728,10 @@ function _listBuiltInNext(nextPageLink, options, callback) { } /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1828,7 +1882,10 @@ class PolicyDefinitions { } /** - * Creates or updates a policy definition. + * @summary Creates or updates a policy definition in a subscription. + * + * This operation creates or updates a policy definition in the given + * subscription with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * create. @@ -1881,7 +1938,10 @@ class PolicyDefinitions { } /** - * Creates or updates a policy definition. + * @summary Creates or updates a policy definition in a subscription. + * + * This operation creates or updates a policy definition in the given + * subscription with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * create. @@ -1956,7 +2016,10 @@ class PolicyDefinitions { } /** - * Deletes a policy definition. + * @summary Deletes a policy definition in a subscription. + * + * This operation deletes the policy definition in the given subscription with + * the given name. * * @param {string} policyDefinitionName The name of the policy definition to * delete. @@ -1987,7 +2050,10 @@ class PolicyDefinitions { } /** - * Deletes a policy definition. + * @summary Deletes a policy definition in a subscription. + * + * This operation deletes the policy definition in the given subscription with + * the given name. * * @param {string} policyDefinitionName The name of the policy definition to * delete. @@ -2039,7 +2105,10 @@ class PolicyDefinitions { } /** - * Gets the policy definition. + * @summary Retrieves a policy definition in a subscription. + * + * This operation retrieves the policy definition in the given subscription + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * get. @@ -2070,7 +2139,10 @@ class PolicyDefinitions { } /** - * Gets the policy definition. + * @summary Retrieves a policy definition in a subscription. + * + * This operation retrieves the policy definition in the given subscription + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * get. @@ -2123,9 +2195,11 @@ class PolicyDefinitions { } /** - * Gets the built in policy definition. + * @summary Retrieves a built-in policy definition. + * + * This operation retrieves the built-in policy definition with the given name. * - * @param {string} policyDefinitionName The name of the built in policy + * @param {string} policyDefinitionName The name of the built-in policy * definition to get. * * @param {object} [options] Optional Parameters. @@ -2154,9 +2228,11 @@ class PolicyDefinitions { } /** - * Gets the built in policy definition. + * @summary Retrieves a built-in policy definition. + * + * This operation retrieves the built-in policy definition with the given name. * - * @param {string} policyDefinitionName The name of the built in policy + * @param {string} policyDefinitionName The name of the built-in policy * definition to get. * * @param {object} [options] Optional Parameters. @@ -2207,7 +2283,10 @@ class PolicyDefinitions { } /** - * Creates or updates a policy definition at management group level. + * @summary Creates or updates a policy definition in a management group. + * + * This operation creates or updates a policy definition in the given + * management group with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * create. @@ -2262,7 +2341,10 @@ class PolicyDefinitions { } /** - * Creates or updates a policy definition at management group level. + * @summary Creates or updates a policy definition in a management group. + * + * This operation creates or updates a policy definition in the given + * management group with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * create. @@ -2339,7 +2421,10 @@ class PolicyDefinitions { } /** - * Deletes a policy definition at management group level. + * @summary Deletes a policy definition in a management group. + * + * This operation deletes the policy definition in the given management group + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * delete. @@ -2372,7 +2457,10 @@ class PolicyDefinitions { } /** - * Deletes a policy definition at management group level. + * @summary Deletes a policy definition in a management group. + * + * This operation deletes the policy definition in the given management group + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * delete. @@ -2426,7 +2514,10 @@ class PolicyDefinitions { } /** - * Gets the policy definition at management group level. + * @summary Retrieve a policy definition in a management group. + * + * This operation retrieves the policy definition in the given management group + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * get. @@ -2459,7 +2550,10 @@ class PolicyDefinitions { } /** - * Gets the policy definition at management group level. + * @summary Retrieve a policy definition in a management group. + * + * This operation retrieves the policy definition in the given management group + * with the given name. * * @param {string} policyDefinitionName The name of the policy definition to * get. @@ -2514,7 +2608,10 @@ class PolicyDefinitions { } /** - * Gets all the policy definitions for a subscription. + * @summary Retrieves policy definitions in a subscription + * + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {object} [options] Optional Parameters. * @@ -2542,7 +2639,10 @@ class PolicyDefinitions { } /** - * Gets all the policy definitions for a subscription. + * @summary Retrieves policy definitions in a subscription + * + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {object} [options] Optional Parameters. * @@ -2593,7 +2693,9 @@ class PolicyDefinitions { } /** - * Gets all the built in policy definitions. + * @summary Retrieve built-in policy definitions + * + * This operation retrieves a list of all the built-in policy definitions. * * @param {object} [options] Optional Parameters. * @@ -2621,7 +2723,9 @@ class PolicyDefinitions { } /** - * Gets all the built in policy definitions. + * @summary Retrieve built-in policy definitions + * + * This operation retrieves a list of all the built-in policy definitions. * * @param {object} [options] Optional Parameters. * @@ -2672,8 +2776,10 @@ class PolicyDefinitions { } /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} managementGroupId The ID of the management group. * @@ -2703,8 +2809,10 @@ class PolicyDefinitions { } /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} managementGroupId The ID of the management group. * @@ -2757,7 +2865,10 @@ class PolicyDefinitions { } /** - * Gets all the policy definitions for a subscription. + * @summary Retrieves policy definitions in a subscription + * + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2788,7 +2899,10 @@ class PolicyDefinitions { } /** - * Gets all the policy definitions for a subscription. + * @summary Retrieves policy definitions in a subscription + * + * This operation retrieves a list of all the policy definitions in a given + * subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2842,7 +2956,9 @@ class PolicyDefinitions { } /** - * Gets all the built in policy definitions. + * @summary Retrieve built-in policy definitions + * + * This operation retrieves a list of all the built-in policy definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2873,7 +2989,9 @@ class PolicyDefinitions { } /** - * Gets all the built in policy definitions. + * @summary Retrieve built-in policy definitions + * + * This operation retrieves a list of all the built-in policy definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2927,8 +3045,10 @@ class PolicyDefinitions { } /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2959,8 +3079,10 @@ class PolicyDefinitions { } /** - * Gets all the policy definitions for a subscription at management group - * level. + * @summary Retrieve policy definitions in a management group + * + * This operation retrieves a list of all the policy definitions in a given + * management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/resourceManagement/lib/policy/operations/policySetDefinitions.js b/lib/services/resourceManagement/lib/policy/operations/policySetDefinitions.js index 151b618d1b..8e6ffd0fd9 100644 --- a/lib/services/resourceManagement/lib/policy/operations/policySetDefinitions.js +++ b/lib/services/resourceManagement/lib/policy/operations/policySetDefinitions.js @@ -15,7 +15,10 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Creates or updates a policy set definition. + * @summary Creates or updates a policy set definition. + * + * This operation creates or updates a policy set definition in the given + * subscription with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to create. @@ -68,7 +71,6 @@ function _createOrUpdate(policySetDefinitionName, parameters, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policySetDefinitionName === null || policySetDefinitionName === undefined || typeof policySetDefinitionName.valueOf() !== 'string') { @@ -77,6 +79,9 @@ function _createOrUpdate(policySetDefinitionName, parameters, options, callback) if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -93,7 +98,7 @@ function _createOrUpdate(policySetDefinitionName, parameters, options, callback) requestUrl = requestUrl.replace('{policySetDefinitionName}', encodeURIComponent(policySetDefinitionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -208,7 +213,10 @@ function _createOrUpdate(policySetDefinitionName, parameters, options, callback) } /** - * Deletes a policy set definition. + * @summary Deletes a policy set definition. + * + * This operation deletes the policy set definition in the given subscription + * with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to delete. @@ -240,12 +248,14 @@ function _deleteMethod(policySetDefinitionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policySetDefinitionName === null || policySetDefinitionName === undefined || typeof policySetDefinitionName.valueOf() !== 'string') { throw new Error('policySetDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -262,7 +272,7 @@ function _deleteMethod(policySetDefinitionName, options, callback) { requestUrl = requestUrl.replace('{policySetDefinitionName}', encodeURIComponent(policySetDefinitionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -329,7 +339,10 @@ function _deleteMethod(policySetDefinitionName, options, callback) { } /** - * Gets the policy set definition. + * @summary Retrieves a policy set definition. + * + * This operation retrieves the policy set definition in the given subscription + * with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -362,12 +375,14 @@ function _get(policySetDefinitionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policySetDefinitionName === null || policySetDefinitionName === undefined || typeof policySetDefinitionName.valueOf() !== 'string') { throw new Error('policySetDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -384,7 +399,7 @@ function _get(policySetDefinitionName, options, callback) { requestUrl = requestUrl.replace('{policySetDefinitionName}', encodeURIComponent(policySetDefinitionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -468,7 +483,10 @@ function _get(policySetDefinitionName, options, callback) { } /** - * Gets the built in policy set definition. + * @summary Retrieves a built in policy set definition. + * + * This operation retrieves the built-in policy set definition with the given + * name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -501,12 +519,14 @@ function _getBuiltIn(policySetDefinitionName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policySetDefinitionName === null || policySetDefinitionName === undefined || typeof policySetDefinitionName.valueOf() !== 'string') { throw new Error('policySetDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -519,7 +539,7 @@ function _getBuiltIn(policySetDefinitionName, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}'; requestUrl = requestUrl.replace('{policySetDefinitionName}', encodeURIComponent(policySetDefinitionName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -603,7 +623,10 @@ function _getBuiltIn(policySetDefinitionName, options, callback) { } /** - * Gets all the policy set definitions for a subscription. + * @summary Retrieves the policy set definitions for a subscription. + * + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {object} [options] Optional Parameters. * @@ -634,9 +657,11 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -652,7 +677,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -736,7 +761,9 @@ function _list(options, callback) { } /** - * Gets all the built in policy set definitions. + * @summary Retrieves built-in policy set definitions. + * + * This operation retrieves a list of all the built-in policy set definitions. * * @param {object} [options] Optional Parameters. * @@ -767,9 +794,11 @@ function _listBuiltIn(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // 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.'); } @@ -781,7 +810,7 @@ function _listBuiltIn(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Authorization/policySetDefinitions'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -865,7 +894,10 @@ function _listBuiltIn(options, callback) { } /** - * Creates or updates a policy set definition at management group level. + * @summary Creates or updates a policy set definition. + * + * This operation creates or updates a policy set definition in the given + * management group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to create. @@ -920,7 +952,6 @@ function _createOrUpdateAtManagementGroup(policySetDefinitionName, parameters, m if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policySetDefinitionName === null || policySetDefinitionName === undefined || typeof policySetDefinitionName.valueOf() !== 'string') { @@ -929,6 +960,9 @@ function _createOrUpdateAtManagementGroup(policySetDefinitionName, parameters, m if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (managementGroupId === null || managementGroupId === undefined || typeof managementGroupId.valueOf() !== 'string') { throw new Error('managementGroupId cannot be null or undefined and it must be of type string.'); } @@ -945,7 +979,7 @@ function _createOrUpdateAtManagementGroup(policySetDefinitionName, parameters, m requestUrl = requestUrl.replace('{policySetDefinitionName}', encodeURIComponent(policySetDefinitionName)); requestUrl = requestUrl.replace('{managementGroupId}', encodeURIComponent(managementGroupId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1060,7 +1094,10 @@ function _createOrUpdateAtManagementGroup(policySetDefinitionName, parameters, m } /** - * Deletes a policy set definition at management group level. + * @summary Deletes a policy set definition. + * + * This operation deletes the policy set definition in the given management + * group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to delete. @@ -1094,12 +1131,14 @@ function _deleteAtManagementGroup(policySetDefinitionName, managementGroupId, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policySetDefinitionName === null || policySetDefinitionName === undefined || typeof policySetDefinitionName.valueOf() !== 'string') { throw new Error('policySetDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (managementGroupId === null || managementGroupId === undefined || typeof managementGroupId.valueOf() !== 'string') { throw new Error('managementGroupId cannot be null or undefined and it must be of type string.'); } @@ -1116,7 +1155,7 @@ function _deleteAtManagementGroup(policySetDefinitionName, managementGroupId, op requestUrl = requestUrl.replace('{policySetDefinitionName}', encodeURIComponent(policySetDefinitionName)); requestUrl = requestUrl.replace('{managementGroupId}', encodeURIComponent(managementGroupId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1183,7 +1222,10 @@ function _deleteAtManagementGroup(policySetDefinitionName, managementGroupId, op } /** - * Gets the policy set definition at management group level. + * @summary Retrieves a policy set definition. + * + * This operation retrieves the policy set definition in the given management + * group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -1218,12 +1260,14 @@ function _getAtManagementGroup(policySetDefinitionName, managementGroupId, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // Validate try { if (policySetDefinitionName === null || policySetDefinitionName === undefined || typeof policySetDefinitionName.valueOf() !== 'string') { throw new Error('policySetDefinitionName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (managementGroupId === null || managementGroupId === undefined || typeof managementGroupId.valueOf() !== 'string') { throw new Error('managementGroupId cannot be null or undefined and it must be of type string.'); } @@ -1240,7 +1284,7 @@ function _getAtManagementGroup(policySetDefinitionName, managementGroupId, optio requestUrl = requestUrl.replace('{policySetDefinitionName}', encodeURIComponent(policySetDefinitionName)); requestUrl = requestUrl.replace('{managementGroupId}', encodeURIComponent(managementGroupId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1324,7 +1368,10 @@ function _getAtManagementGroup(policySetDefinitionName, managementGroupId, optio } /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} managementGroupId The ID of the management group. * @@ -1357,9 +1404,11 @@ function _listByManagementGroup(managementGroupId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-06-01-preview'; // 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 (managementGroupId === null || managementGroupId === undefined || typeof managementGroupId.valueOf() !== 'string') { throw new Error('managementGroupId cannot be null or undefined and it must be of type string.'); } @@ -1375,7 +1424,7 @@ function _listByManagementGroup(managementGroupId, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions'; requestUrl = requestUrl.replace('{managementGroupId}', encodeURIComponent(managementGroupId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1459,7 +1508,10 @@ function _listByManagementGroup(managementGroupId, options, callback) { } /** - * Gets all the policy set definitions for a subscription. + * @summary Retrieves the policy set definitions for a subscription. + * + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1588,7 +1640,9 @@ function _listNext(nextPageLink, options, callback) { } /** - * Gets all the built in policy set definitions. + * @summary Retrieves built-in policy set definitions. + * + * This operation retrieves a list of all the built-in policy set definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1717,7 +1771,10 @@ function _listBuiltInNext(nextPageLink, options, callback) { } /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1869,7 +1926,10 @@ class PolicySetDefinitions { } /** - * Creates or updates a policy set definition. + * @summary Creates or updates a policy set definition. + * + * This operation creates or updates a policy set definition in the given + * subscription with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to create. @@ -1920,7 +1980,10 @@ class PolicySetDefinitions { } /** - * Creates or updates a policy set definition. + * @summary Creates or updates a policy set definition. + * + * This operation creates or updates a policy set definition in the given + * subscription with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to create. @@ -1993,7 +2056,10 @@ class PolicySetDefinitions { } /** - * Deletes a policy set definition. + * @summary Deletes a policy set definition. + * + * This operation deletes the policy set definition in the given subscription + * with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to delete. @@ -2024,7 +2090,10 @@ class PolicySetDefinitions { } /** - * Deletes a policy set definition. + * @summary Deletes a policy set definition. + * + * This operation deletes the policy set definition in the given subscription + * with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to delete. @@ -2076,7 +2145,10 @@ class PolicySetDefinitions { } /** - * Gets the policy set definition. + * @summary Retrieves a policy set definition. + * + * This operation retrieves the policy set definition in the given subscription + * with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -2107,7 +2179,10 @@ class PolicySetDefinitions { } /** - * Gets the policy set definition. + * @summary Retrieves a policy set definition. + * + * This operation retrieves the policy set definition in the given subscription + * with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -2160,7 +2235,10 @@ class PolicySetDefinitions { } /** - * Gets the built in policy set definition. + * @summary Retrieves a built in policy set definition. + * + * This operation retrieves the built-in policy set definition with the given + * name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -2191,7 +2269,10 @@ class PolicySetDefinitions { } /** - * Gets the built in policy set definition. + * @summary Retrieves a built in policy set definition. + * + * This operation retrieves the built-in policy set definition with the given + * name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -2244,7 +2325,10 @@ class PolicySetDefinitions { } /** - * Gets all the policy set definitions for a subscription. + * @summary Retrieves the policy set definitions for a subscription. + * + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {object} [options] Optional Parameters. * @@ -2272,7 +2356,10 @@ class PolicySetDefinitions { } /** - * Gets all the policy set definitions for a subscription. + * @summary Retrieves the policy set definitions for a subscription. + * + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {object} [options] Optional Parameters. * @@ -2323,7 +2410,9 @@ class PolicySetDefinitions { } /** - * Gets all the built in policy set definitions. + * @summary Retrieves built-in policy set definitions. + * + * This operation retrieves a list of all the built-in policy set definitions. * * @param {object} [options] Optional Parameters. * @@ -2351,7 +2440,9 @@ class PolicySetDefinitions { } /** - * Gets all the built in policy set definitions. + * @summary Retrieves built-in policy set definitions. + * + * This operation retrieves a list of all the built-in policy set definitions. * * @param {object} [options] Optional Parameters. * @@ -2402,7 +2493,10 @@ class PolicySetDefinitions { } /** - * Creates or updates a policy set definition at management group level. + * @summary Creates or updates a policy set definition. + * + * This operation creates or updates a policy set definition in the given + * management group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to create. @@ -2455,7 +2549,10 @@ class PolicySetDefinitions { } /** - * Creates or updates a policy set definition at management group level. + * @summary Creates or updates a policy set definition. + * + * This operation creates or updates a policy set definition in the given + * management group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to create. @@ -2530,7 +2627,10 @@ class PolicySetDefinitions { } /** - * Deletes a policy set definition at management group level. + * @summary Deletes a policy set definition. + * + * This operation deletes the policy set definition in the given management + * group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to delete. @@ -2563,7 +2663,10 @@ class PolicySetDefinitions { } /** - * Deletes a policy set definition at management group level. + * @summary Deletes a policy set definition. + * + * This operation deletes the policy set definition in the given management + * group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to delete. @@ -2617,7 +2720,10 @@ class PolicySetDefinitions { } /** - * Gets the policy set definition at management group level. + * @summary Retrieves a policy set definition. + * + * This operation retrieves the policy set definition in the given management + * group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -2650,7 +2756,10 @@ class PolicySetDefinitions { } /** - * Gets the policy set definition at management group level. + * @summary Retrieves a policy set definition. + * + * This operation retrieves the policy set definition in the given management + * group with the given name. * * @param {string} policySetDefinitionName The name of the policy set * definition to get. @@ -2705,7 +2814,10 @@ class PolicySetDefinitions { } /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} managementGroupId The ID of the management group. * @@ -2735,7 +2847,10 @@ class PolicySetDefinitions { } /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} managementGroupId The ID of the management group. * @@ -2788,7 +2903,10 @@ class PolicySetDefinitions { } /** - * Gets all the policy set definitions for a subscription. + * @summary Retrieves the policy set definitions for a subscription. + * + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2819,7 +2937,10 @@ class PolicySetDefinitions { } /** - * Gets all the policy set definitions for a subscription. + * @summary Retrieves the policy set definitions for a subscription. + * + * This operation retrieves a list of all the policy set definitions in the + * given subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2873,7 +2994,9 @@ class PolicySetDefinitions { } /** - * Gets all the built in policy set definitions. + * @summary Retrieves built-in policy set definitions. + * + * This operation retrieves a list of all the built-in policy set definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2904,7 +3027,9 @@ class PolicySetDefinitions { } /** - * Gets all the built in policy set definitions. + * @summary Retrieves built-in policy set definitions. + * + * This operation retrieves a list of all the built-in policy set definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2958,7 +3083,10 @@ class PolicySetDefinitions { } /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2989,7 +3117,10 @@ class PolicySetDefinitions { } /** - * Gets all the policy set definitions for a subscription at management group. + * @summary Retrieves all policy set definitions in management group. + * + * This operation retrieves a list of all the a policy set definition in the + * given management group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/resourceManagement/lib/policy/policyClient.d.ts b/lib/services/resourceManagement/lib/policy/policyClient.d.ts index ee8cef380a..2b1b11dcf8 100644 --- a/lib/services/resourceManagement/lib/policy/policyClient.d.ts +++ b/lib/services/resourceManagement/lib/policy/policyClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class PolicyClient extends AzureServiceClient { +export default class PolicyClient extends AzureServiceClient { /** * Initializes a new instance of the PolicyClient class. * @constructor @@ -33,11 +34,11 @@ declare class PolicyClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -46,6 +47,8 @@ declare class PolicyClient extends AzureServiceClient { subscriptionId: string; + apiVersion: string; + acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -54,8 +57,8 @@ declare class PolicyClient extends AzureServiceClient { // Operation groups policyAssignments: operations.PolicyAssignments; - policySetDefinitions: operations.PolicySetDefinitions; policyDefinitions: operations.PolicyDefinitions; + policySetDefinitions: operations.PolicySetDefinitions; } -export = PolicyClient; +export { PolicyClient, models as PolicyModels }; diff --git a/lib/services/resourceManagement/lib/policy/policyClient.js b/lib/services/resourceManagement/lib/policy/policyClient.js index 873abbc464..663736fe40 100644 --- a/lib/services/resourceManagement/lib/policy/policyClient.js +++ b/lib/services/resourceManagement/lib/policy/policyClient.js @@ -34,9 +34,9 @@ class PolicyClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -50,6 +50,7 @@ class PolicyClient extends ServiceClient { super(credentials, options); + this.apiVersion = '2018-05-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -72,8 +73,8 @@ class PolicyClient extends ServiceClient { this.generateClientRequestId = options.generateClientRequestId; } this.policyAssignments = new operations.PolicyAssignments(this); - this.policySetDefinitions = new operations.PolicySetDefinitions(this); this.policyDefinitions = new operations.PolicyDefinitions(this); + this.policySetDefinitions = new operations.PolicySetDefinitions(this); this.models = models; msRest.addSerializationMixin(this); } @@ -81,3 +82,6 @@ class PolicyClient extends ServiceClient { } module.exports = PolicyClient; +module.exports['default'] = PolicyClient; +module.exports.PolicyClient = PolicyClient; +module.exports.PolicyModels = models; diff --git a/lib/services/resourceManagement/lib/resource/models/aliasType.js b/lib/services/resourceManagement/lib/resource/models/aliasType.js index 1ea286de14..eb596f3fef 100644 --- a/lib/services/resourceManagement/lib/resource/models/aliasType.js +++ b/lib/services/resourceManagement/lib/resource/models/aliasType.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The alias type. * diff --git a/lib/services/resourceManagement/lib/resource/models/dependency.js b/lib/services/resourceManagement/lib/resource/models/dependency.js index 7381f8d409..a708ee752c 100644 --- a/lib/services/resourceManagement/lib/resource/models/dependency.js +++ b/lib/services/resourceManagement/lib/resource/models/dependency.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Deployment dependency information. * diff --git a/lib/services/resourceManagement/lib/resource/models/deployment.js b/lib/services/resourceManagement/lib/resource/models/deployment.js index c7540d8412..85610fa426 100644 --- a/lib/services/resourceManagement/lib/resource/models/deployment.js +++ b/lib/services/resourceManagement/lib/resource/models/deployment.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Deployment operation parameters. * @@ -19,6 +17,7 @@ const models = require('./index'); class Deployment { /** * Create a Deployment. + * @member {string} [location] The location to store the deployment data. * @member {object} properties The deployment properties. * @member {object} [properties.template] The template content. You use this * element when you want to pass the template syntax directly in the request @@ -62,6 +61,14 @@ class Deployment { * during deployment. By logging information about the request or response, * you could potentially expose sensitive data that is retrieved through the * deployment operations. + * @member {object} [properties.onErrorDeployment] The deployment on error + * behavior. + * @member {string} [properties.onErrorDeployment.type] The deployment on + * error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * @member {string} [properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. */ constructor() { } @@ -80,6 +87,13 @@ class Deployment { name: 'Composite', className: 'Deployment', modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, properties: { required: true, serializedName: 'properties', diff --git a/lib/services/resourceManagement/lib/resource/models/deploymentExtended.js b/lib/services/resourceManagement/lib/resource/models/deploymentExtended.js index c60491bae6..db0acfc596 100644 --- a/lib/services/resourceManagement/lib/resource/models/deploymentExtended.js +++ b/lib/services/resourceManagement/lib/resource/models/deploymentExtended.js @@ -15,12 +15,14 @@ const models = require('./index'); /** * Deployment information. * + * @extends models['BaseResource'] */ -class DeploymentExtended { +class DeploymentExtended extends models['BaseResource'] { /** * Create a DeploymentExtended. * @member {string} [id] The ID of the deployment. - * @member {string} name The name of the deployment. + * @member {string} [name] The name of the deployment. + * @member {string} [location] the location of the deployment. * @member {object} [properties] Deployment properties. * @member {string} [properties.provisioningState] The state of the * provisioning. @@ -63,8 +65,19 @@ class DeploymentExtended { * during deployment. By logging information about the request or response, * you could potentially expose sensitive data that is retrieved through the * deployment operations. + * @member {object} [properties.onErrorDeployment] The deployment on error + * behavior. + * @member {string} [properties.onErrorDeployment.provisioningState] The + * state of the provisioning for the on error deployment. + * @member {string} [properties.onErrorDeployment.type] The deployment on + * error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * @member {string} [properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. */ constructor() { + super(); } /** @@ -83,18 +96,27 @@ class DeploymentExtended { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' } }, name: { - required: true, + required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' } }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, properties: { required: false, serializedName: 'properties', diff --git a/lib/services/resourceManagement/lib/resource/models/deploymentOperation.js b/lib/services/resourceManagement/lib/resource/models/deploymentOperation.js index 397c516e9c..1cd5c0c958 100644 --- a/lib/services/resourceManagement/lib/resource/models/deploymentOperation.js +++ b/lib/services/resourceManagement/lib/resource/models/deploymentOperation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Deployment operation information. * diff --git a/lib/services/resourceManagement/lib/resource/models/deploymentOperationProperties.js b/lib/services/resourceManagement/lib/resource/models/deploymentOperationProperties.js index 11e1067be6..cf2396f279 100644 --- a/lib/services/resourceManagement/lib/resource/models/deploymentOperationProperties.js +++ b/lib/services/resourceManagement/lib/resource/models/deploymentOperationProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Deployment operation properties. * diff --git a/lib/services/resourceManagement/lib/resource/models/deploymentProperties.js b/lib/services/resourceManagement/lib/resource/models/deploymentProperties.js index 75709ab10d..200c690013 100644 --- a/lib/services/resourceManagement/lib/resource/models/deploymentProperties.js +++ b/lib/services/resourceManagement/lib/resource/models/deploymentProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Deployment properties. * @@ -58,6 +56,12 @@ class DeploymentProperties { * during deployment. By logging information about the request or response, * you could potentially expose sensitive data that is retrieved through the * deployment operations. + * @member {object} [onErrorDeployment] The deployment on error behavior. + * @member {string} [onErrorDeployment.type] The deployment on error behavior + * type. Possible values are LastSuccessful and SpecificDeployment. Possible + * values include: 'LastSuccessful', 'SpecificDeployment' + * @member {string} [onErrorDeployment.deploymentName] The deployment to be + * used on error case. */ constructor() { } @@ -121,6 +125,14 @@ class DeploymentProperties { name: 'Composite', className: 'DebugSetting' } + }, + onErrorDeployment: { + required: false, + serializedName: 'onErrorDeployment', + type: { + name: 'Composite', + className: 'OnErrorDeployment' + } } } } diff --git a/lib/services/resourceManagement/lib/resource/models/deploymentPropertiesExtended.js b/lib/services/resourceManagement/lib/resource/models/deploymentPropertiesExtended.js index 84e0f9c31a..f5a2c0f7ec 100644 --- a/lib/services/resourceManagement/lib/resource/models/deploymentPropertiesExtended.js +++ b/lib/services/resourceManagement/lib/resource/models/deploymentPropertiesExtended.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Deployment properties with additional details. * @@ -53,6 +51,14 @@ class DeploymentPropertiesExtended { * during deployment. By logging information about the request or response, * you could potentially expose sensitive data that is retrieved through the * deployment operations. + * @member {object} [onErrorDeployment] The deployment on error behavior. + * @member {string} [onErrorDeployment.provisioningState] The state of the + * provisioning for the on error deployment. + * @member {string} [onErrorDeployment.type] The deployment on error behavior + * type. Possible values are LastSuccessful and SpecificDeployment. Possible + * values include: 'LastSuccessful', 'SpecificDeployment' + * @member {string} [onErrorDeployment.deploymentName] The deployment to be + * used on error case. */ constructor() { } @@ -177,6 +183,14 @@ class DeploymentPropertiesExtended { name: 'Composite', className: 'DebugSetting' } + }, + onErrorDeployment: { + required: false, + serializedName: 'onErrorDeployment', + type: { + name: 'Composite', + className: 'OnErrorDeploymentExtended' + } } } } diff --git a/lib/services/resourceManagement/lib/resource/models/deploymentValidateResult.js b/lib/services/resourceManagement/lib/resource/models/deploymentValidateResult.js index 4afdcc3636..bafb2d7ba4 100644 --- a/lib/services/resourceManagement/lib/resource/models/deploymentValidateResult.js +++ b/lib/services/resourceManagement/lib/resource/models/deploymentValidateResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information from validate template deployment response. * @@ -68,6 +66,16 @@ class DeploymentValidateResult { * during deployment. By logging information about the request or response, * you could potentially expose sensitive data that is retrieved through the * deployment operations. + * @member {object} [properties.onErrorDeployment] The deployment on error + * behavior. + * @member {string} [properties.onErrorDeployment.provisioningState] The + * state of the provisioning for the on error deployment. + * @member {string} [properties.onErrorDeployment.type] The deployment on + * error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * @member {string} [properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. */ constructor() { } diff --git a/lib/services/resourceManagement/lib/resource/models/genericResource.js b/lib/services/resourceManagement/lib/resource/models/genericResource.js index f4749ed9b4..015ea980f7 100644 --- a/lib/services/resourceManagement/lib/resource/models/genericResource.js +++ b/lib/services/resourceManagement/lib/resource/models/genericResource.js @@ -42,7 +42,12 @@ class GenericResource extends models['Resource'] { * identity. * @member {string} [identity.tenantId] The tenant ID of resource. * @member {string} [identity.type] The identity type. Possible values - * include: 'SystemAssigned' + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the resource. The user identity dictionary key + * references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ constructor() { super(); diff --git a/lib/services/resourceManagement/lib/resource/models/identity.js b/lib/services/resourceManagement/lib/resource/models/identity.js index 14c1fe4686..415e27e75d 100644 --- a/lib/services/resourceManagement/lib/resource/models/identity.js +++ b/lib/services/resourceManagement/lib/resource/models/identity.js @@ -20,7 +20,11 @@ class Identity { * @member {string} [principalId] The principal ID of resource identity. * @member {string} [tenantId] The tenant ID of resource. * @member {string} [type] The identity type. Possible values include: - * 'SystemAssigned' + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + * @member {object} [userAssignedIdentities] The list of user identities + * associated with the resource. The user identity dictionary key references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ constructor() { } @@ -60,7 +64,22 @@ class Identity { serializedName: 'type', type: { name: 'Enum', - allowedValues: [ 'SystemAssigned' ] + allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ] + } + }, + userAssignedIdentities: { + required: false, + serializedName: 'userAssignedIdentities', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'IdentityUserAssignedIdentitiesValueElementType', + type: { + name: 'Composite', + className: 'IdentityUserAssignedIdentitiesValue' + } + } } } } diff --git a/lib/services/resourceManagement/lib/resource/models/identityUserAssignedIdentitiesValue.js b/lib/services/resourceManagement/lib/resource/models/identityUserAssignedIdentitiesValue.js new file mode 100644 index 0000000000..20d7e92efb --- /dev/null +++ b/lib/services/resourceManagement/lib/resource/models/identityUserAssignedIdentitiesValue.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a IdentityUserAssignedIdentitiesValue. + */ +class IdentityUserAssignedIdentitiesValue { + /** + * Create a IdentityUserAssignedIdentitiesValue. + * @member {string} [principalId] The principal id of user assigned identity. + * @member {string} [clientId] The client id of user assigned identity. + */ + constructor() { + } + + /** + * Defines the metadata of IdentityUserAssignedIdentitiesValue + * + * @returns {object} metadata of IdentityUserAssignedIdentitiesValue + * + */ + mapper() { + return { + required: false, + serializedName: 'Identity_userAssignedIdentitiesValue', + type: { + name: 'Composite', + className: 'IdentityUserAssignedIdentitiesValue', + modelProperties: { + principalId: { + required: false, + readOnly: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + clientId: { + required: false, + readOnly: true, + serializedName: 'clientId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IdentityUserAssignedIdentitiesValue; diff --git a/lib/services/resourceManagement/lib/resource/models/index.d.ts b/lib/services/resourceManagement/lib/resource/models/index.d.ts index a7d1abcc78..ece6fc41ba 100644 --- a/lib/services/resourceManagement/lib/resource/models/index.d.ts +++ b/lib/services/resourceManagement/lib/resource/models/index.d.ts @@ -104,6 +104,22 @@ export interface DebugSetting { detailLevel?: string; } +/** + * @class + * Initializes a new instance of the OnErrorDeployment class. + * @constructor + * Deployment on error behavior. + * + * @member {string} [type] The deployment on error behavior type. Possible + * values are LastSuccessful and SpecificDeployment. Possible values include: + * 'LastSuccessful', 'SpecificDeployment' + * @member {string} [deploymentName] The deployment to be used on error case. + */ +export interface OnErrorDeployment { + type?: string; + deploymentName?: string; +} + /** * @class * Initializes a new instance of the DeploymentProperties class. @@ -148,6 +164,12 @@ export interface DebugSetting { * deployment. By logging information about the request or response, you could * potentially expose sensitive data that is retrieved through the deployment * operations. + * @member {object} [onErrorDeployment] The deployment on error behavior. + * @member {string} [onErrorDeployment.type] The deployment on error behavior + * type. Possible values are LastSuccessful and SpecificDeployment. Possible + * values include: 'LastSuccessful', 'SpecificDeployment' + * @member {string} [onErrorDeployment.deploymentName] The deployment to be + * used on error case. */ export interface DeploymentProperties { template?: any; @@ -156,6 +178,7 @@ export interface DeploymentProperties { parametersLink?: ParametersLink; mode: string; debugSetting?: DebugSetting; + onErrorDeployment?: OnErrorDeployment; } /** @@ -164,6 +187,7 @@ export interface DeploymentProperties { * @constructor * Deployment operation parameters. * + * @member {string} [location] The location to store the deployment data. * @member {object} properties The deployment properties. * @member {object} [properties.template] The template content. You use this * element when you want to pass the template syntax directly in the request @@ -207,8 +231,16 @@ export interface DeploymentProperties { * deployment. By logging information about the request or response, you could * potentially expose sensitive data that is retrieved through the deployment * operations. + * @member {object} [properties.onErrorDeployment] The deployment on error + * behavior. + * @member {string} [properties.onErrorDeployment.type] The deployment on error + * behavior type. Possible values are LastSuccessful and SpecificDeployment. + * Possible values include: 'LastSuccessful', 'SpecificDeployment' + * @member {string} [properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. */ export interface Deployment { + location?: string; properties: DeploymentProperties; } @@ -344,6 +376,25 @@ export interface Dependency { resourceName?: string; } +/** + * @class + * Initializes a new instance of the OnErrorDeploymentExtended class. + * @constructor + * Deployment on error behavior with additional details. + * + * @member {string} [provisioningState] The state of the provisioning for the + * on error deployment. + * @member {string} [type] The deployment on error behavior type. Possible + * values are LastSuccessful and SpecificDeployment. Possible values include: + * 'LastSuccessful', 'SpecificDeployment' + * @member {string} [deploymentName] The deployment to be used on error case. + */ +export interface OnErrorDeploymentExtended { + readonly provisioningState?: string; + type?: string; + deploymentName?: string; +} + /** * @class * Initializes a new instance of the DeploymentPropertiesExtended class. @@ -382,6 +433,14 @@ export interface Dependency { * deployment. By logging information about the request or response, you could * potentially expose sensitive data that is retrieved through the deployment * operations. + * @member {object} [onErrorDeployment] The deployment on error behavior. + * @member {string} [onErrorDeployment.provisioningState] The state of the + * provisioning for the on error deployment. + * @member {string} [onErrorDeployment.type] The deployment on error behavior + * type. Possible values are LastSuccessful and SpecificDeployment. Possible + * values include: 'LastSuccessful', 'SpecificDeployment' + * @member {string} [onErrorDeployment.deploymentName] The deployment to be + * used on error case. */ export interface DeploymentPropertiesExtended { readonly provisioningState?: string; @@ -396,6 +455,7 @@ export interface DeploymentPropertiesExtended { parametersLink?: ParametersLink; mode?: string; debugSetting?: DebugSetting; + onErrorDeployment?: OnErrorDeploymentExtended; } /** @@ -452,6 +512,15 @@ export interface DeploymentPropertiesExtended { * deployment. By logging information about the request or response, you could * potentially expose sensitive data that is retrieved through the deployment * operations. + * @member {object} [properties.onErrorDeployment] The deployment on error + * behavior. + * @member {string} [properties.onErrorDeployment.provisioningState] The state + * of the provisioning for the on error deployment. + * @member {string} [properties.onErrorDeployment.type] The deployment on error + * behavior type. Possible values are LastSuccessful and SpecificDeployment. + * Possible values include: 'LastSuccessful', 'SpecificDeployment' + * @member {string} [properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. */ export interface DeploymentValidateResult { error?: ResourceManagementErrorWithDetails; @@ -465,7 +534,8 @@ export interface DeploymentValidateResult { * Deployment information. * * @member {string} [id] The ID of the deployment. - * @member {string} name The name of the deployment. + * @member {string} [name] The name of the deployment. + * @member {string} [location] the location of the deployment. * @member {object} [properties] Deployment properties. * @member {string} [properties.provisioningState] The state of the * provisioning. @@ -507,10 +577,20 @@ export interface DeploymentValidateResult { * deployment. By logging information about the request or response, you could * potentially expose sensitive data that is retrieved through the deployment * operations. + * @member {object} [properties.onErrorDeployment] The deployment on error + * behavior. + * @member {string} [properties.onErrorDeployment.provisioningState] The state + * of the provisioning for the on error deployment. + * @member {string} [properties.onErrorDeployment.type] The deployment on error + * behavior type. Possible values are LastSuccessful and SpecificDeployment. + * Possible values include: 'LastSuccessful', 'SpecificDeployment' + * @member {string} [properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. */ -export interface DeploymentExtended { - id?: string; - name: string; +export interface DeploymentExtended extends BaseResource { + readonly id?: string; + readonly name?: string; + location?: string; properties?: DeploymentPropertiesExtended; } @@ -556,6 +636,18 @@ export interface Sku { capacity?: number; } +/** + * @class + * Initializes a new instance of the IdentityUserAssignedIdentitiesValue class. + * @constructor + * @member {string} [principalId] The principal id of user assigned identity. + * @member {string} [clientId] The client id of user assigned identity. + */ +export interface IdentityUserAssignedIdentitiesValue { + readonly principalId?: string; + readonly clientId?: string; +} + /** * @class * Initializes a new instance of the Identity class. @@ -565,19 +657,24 @@ export interface Sku { * @member {string} [principalId] The principal ID of resource identity. * @member {string} [tenantId] The tenant ID of resource. * @member {string} [type] The identity type. Possible values include: - * 'SystemAssigned' + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + * @member {object} [userAssignedIdentities] The list of user identities + * associated with the resource. The user identity dictionary key references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ export interface Identity { readonly principalId?: string; readonly tenantId?: string; type?: string; + userAssignedIdentities?: { [propertyName: string]: IdentityUserAssignedIdentitiesValue }; } /** * @class * Initializes a new instance of the Resource class. * @constructor - * Resource. + * Specified resource. * * @member {string} [id] Resource ID * @member {string} [name] Resource name @@ -620,7 +717,11 @@ export interface Resource extends BaseResource { * identity. * @member {string} [identity.tenantId] The tenant ID of resource. * @member {string} [identity.type] The identity type. Possible values include: - * 'SystemAssigned' + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + * @member {object} [identity.userAssignedIdentities] The list of user + * identities associated with the resource. The user identity dictionary key + * references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ export interface GenericResource extends Resource { plan?: Plan; @@ -660,9 +761,9 @@ export interface ResourceGroupProperties { * resource group. * @member {object} [tags] The tags attached to the resource group. */ -export interface ResourceGroup { +export interface ResourceGroup extends BaseResource { readonly id?: string; - name?: string; + readonly name?: string; properties?: ResourceGroupProperties; location: string; managedBy?: string; @@ -747,8 +848,8 @@ export interface TagCount { * @member {string} [count.type] Type of count. * @member {number} [count.value] Value of count. */ -export interface TagValue { - id?: string; +export interface TagValue extends BaseResource { + readonly id?: string; tagValue?: string; count?: TagCount; } @@ -769,7 +870,7 @@ export interface TagValue { * @member {array} [values] The list of tag values. */ export interface TagDetails { - id?: string; + readonly id?: string; tagName?: string; count?: TagCount; values?: TagValue[]; @@ -876,7 +977,7 @@ export interface DeploymentOperation { * @member {string} [publisher] Operation description. * @member {string} [provider] Operation provider. * @member {string} [resource] Operation resource. - * @member {string} [operation] Operation. + * @member {string} [operation] Resource provider operation. * @member {string} [description] Operation description. */ export interface ResourceProviderOperationDisplayProperties { @@ -919,6 +1020,59 @@ export interface ResourceGroupExportResult { error?: ResourceManagementErrorWithDetails; } +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * The object that represents the operation. + * + * @member {string} [provider] Service provider: Microsoft.Resources + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + * @member {string} [description] Description of the operation. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Microsoft.Resources operation + * + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Resources + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + * @member {string} [display.description] Description of the operation. + */ +export interface Operation { + name?: string; + display?: OperationDisplay; +} + + +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor + * Result of the request to list Microsoft.Resources operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface OperationListResult extends Array { + nextLink?: string; +} /** * @class diff --git a/lib/services/resourceManagement/lib/resource/models/index.js b/lib/services/resourceManagement/lib/resource/models/index.js index d3190d8dc9..9b031abc9a 100644 --- a/lib/services/resourceManagement/lib/resource/models/index.js +++ b/lib/services/resourceManagement/lib/resource/models/index.js @@ -24,6 +24,7 @@ exports.ResourceGroupFilter = require('./resourceGroupFilter'); exports.TemplateLink = require('./templateLink'); exports.ParametersLink = require('./parametersLink'); exports.DebugSetting = require('./debugSetting'); +exports.OnErrorDeployment = require('./onErrorDeployment'); exports.DeploymentProperties = require('./deploymentProperties'); exports.Deployment = require('./deployment'); exports.DeploymentExportResult = require('./deploymentExportResult'); @@ -34,11 +35,13 @@ exports.ProviderResourceType = require('./providerResourceType'); exports.Provider = require('./provider'); exports.BasicDependency = require('./basicDependency'); exports.Dependency = require('./dependency'); +exports.OnErrorDeploymentExtended = require('./onErrorDeploymentExtended'); exports.DeploymentPropertiesExtended = require('./deploymentPropertiesExtended'); exports.DeploymentValidateResult = require('./deploymentValidateResult'); exports.DeploymentExtended = require('./deploymentExtended'); exports.Plan = require('./plan'); exports.Sku = require('./sku'); +exports.IdentityUserAssignedIdentitiesValue = require('./identityUserAssignedIdentitiesValue'); exports.Identity = require('./identity'); exports.Resource = require('./resource'); exports.GenericResource = require('./genericResource'); @@ -57,6 +60,9 @@ exports.DeploymentOperation = require('./deploymentOperation'); exports.ResourceProviderOperationDisplayProperties = require('./resourceProviderOperationDisplayProperties'); exports.SubResource = require('./subResource'); exports.ResourceGroupExportResult = require('./resourceGroupExportResult'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.OperationListResult = require('./operationListResult'); exports.DeploymentListResult = require('./deploymentListResult'); exports.ProviderListResult = require('./providerListResult'); exports.ResourceListResult = require('./resourceListResult'); diff --git a/lib/services/resourceManagement/lib/resource/models/onErrorDeployment.js b/lib/services/resourceManagement/lib/resource/models/onErrorDeployment.js new file mode 100644 index 0000000000..acae2625e4 --- /dev/null +++ b/lib/services/resourceManagement/lib/resource/models/onErrorDeployment.js @@ -0,0 +1,63 @@ +/* + * 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'; + +/** + * Deployment on error behavior. + * + */ +class OnErrorDeployment { + /** + * Create a OnErrorDeployment. + * @member {string} [type] The deployment on error behavior type. Possible + * values are LastSuccessful and SpecificDeployment. Possible values include: + * 'LastSuccessful', 'SpecificDeployment' + * @member {string} [deploymentName] The deployment to be used on error case. + */ + constructor() { + } + + /** + * Defines the metadata of OnErrorDeployment + * + * @returns {object} metadata of OnErrorDeployment + * + */ + mapper() { + return { + required: false, + serializedName: 'OnErrorDeployment', + type: { + name: 'Composite', + className: 'OnErrorDeployment', + modelProperties: { + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'LastSuccessful', 'SpecificDeployment' ] + } + }, + deploymentName: { + required: false, + serializedName: 'deploymentName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OnErrorDeployment; diff --git a/lib/services/resourceManagement/lib/resource/models/onErrorDeploymentExtended.js b/lib/services/resourceManagement/lib/resource/models/onErrorDeploymentExtended.js new file mode 100644 index 0000000000..8ab0a6dfde --- /dev/null +++ b/lib/services/resourceManagement/lib/resource/models/onErrorDeploymentExtended.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * Deployment on error behavior with additional details. + * + */ +class OnErrorDeploymentExtended { + /** + * Create a OnErrorDeploymentExtended. + * @member {string} [provisioningState] The state of the provisioning for the + * on error deployment. + * @member {string} [type] The deployment on error behavior type. Possible + * values are LastSuccessful and SpecificDeployment. Possible values include: + * 'LastSuccessful', 'SpecificDeployment' + * @member {string} [deploymentName] The deployment to be used on error case. + */ + constructor() { + } + + /** + * Defines the metadata of OnErrorDeploymentExtended + * + * @returns {object} metadata of OnErrorDeploymentExtended + * + */ + mapper() { + return { + required: false, + serializedName: 'OnErrorDeploymentExtended', + type: { + name: 'Composite', + className: 'OnErrorDeploymentExtended', + modelProperties: { + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'LastSuccessful', 'SpecificDeployment' ] + } + }, + deploymentName: { + required: false, + serializedName: 'deploymentName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OnErrorDeploymentExtended; diff --git a/lib/services/resourceManagement/lib/resource/models/operation.js b/lib/services/resourceManagement/lib/resource/models/operation.js new file mode 100644 index 0000000000..72379472eb --- /dev/null +++ b/lib/services/resourceManagement/lib/resource/models/operation.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Microsoft.Resources operation + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Resources + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + * @member {string} [display.description] Description of the operation. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/resourceManagement/lib/resource/models/operationDisplay.js b/lib/services/resourceManagement/lib/resource/models/operationDisplay.js new file mode 100644 index 0000000000..43cca64606 --- /dev/null +++ b/lib/services/resourceManagement/lib/resource/models/operationDisplay.js @@ -0,0 +1,77 @@ +/* + * 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 object that represents the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Service provider: Microsoft.Resources + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + * @member {string} [description] Description of the operation. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/resourceManagement/lib/resource/models/operationListResult.js b/lib/services/resourceManagement/lib/resource/models/operationListResult.js new file mode 100644 index 0000000000..ea6f61a74a --- /dev/null +++ b/lib/services/resourceManagement/lib/resource/models/operationListResult.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'; + +/** + * Result of the request to list Microsoft.Resources operations. It contains a + * list of operations and a URL link to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/resourceManagement/lib/resource/models/provider.js b/lib/services/resourceManagement/lib/resource/models/provider.js index 2ebc014fa1..e49b4bff6d 100644 --- a/lib/services/resourceManagement/lib/resource/models/provider.js +++ b/lib/services/resourceManagement/lib/resource/models/provider.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Resource provider information. * diff --git a/lib/services/resourceManagement/lib/resource/models/providerResourceType.js b/lib/services/resourceManagement/lib/resource/models/providerResourceType.js index 8878b4f4d1..05b83ddf13 100644 --- a/lib/services/resourceManagement/lib/resource/models/providerResourceType.js +++ b/lib/services/resourceManagement/lib/resource/models/providerResourceType.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Resource type managed by the resource provider. * diff --git a/lib/services/resourceManagement/lib/resource/models/resource.js b/lib/services/resourceManagement/lib/resource/models/resource.js index 9784ef4a43..5ff2f45ac9 100644 --- a/lib/services/resourceManagement/lib/resource/models/resource.js +++ b/lib/services/resourceManagement/lib/resource/models/resource.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * Resource. + * Specified resource. * * @extends models['BaseResource'] */ diff --git a/lib/services/resourceManagement/lib/resource/models/resourceGroup.js b/lib/services/resourceManagement/lib/resource/models/resourceGroup.js index d95e282632..97011326d4 100644 --- a/lib/services/resourceManagement/lib/resource/models/resourceGroup.js +++ b/lib/services/resourceManagement/lib/resource/models/resourceGroup.js @@ -15,8 +15,9 @@ const models = require('./index'); /** * Resource group information. * + * @extends models['BaseResource'] */ -class ResourceGroup { +class ResourceGroup extends models['BaseResource'] { /** * Create a ResourceGroup. * @member {string} [id] The ID of the resource group. @@ -31,6 +32,7 @@ class ResourceGroup { * @member {object} [tags] The tags attached to the resource group. */ constructor() { + super(); } /** @@ -57,6 +59,7 @@ class ResourceGroup { }, name: { required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' diff --git a/lib/services/resourceManagement/lib/resource/models/resourceGroupExportResult.js b/lib/services/resourceManagement/lib/resource/models/resourceGroupExportResult.js index 08fe661cfe..407089686f 100644 --- a/lib/services/resourceManagement/lib/resource/models/resourceGroupExportResult.js +++ b/lib/services/resourceManagement/lib/resource/models/resourceGroupExportResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Resource group export result. * diff --git a/lib/services/resourceManagement/lib/resource/models/resourceGroupPatchable.js b/lib/services/resourceManagement/lib/resource/models/resourceGroupPatchable.js index 8da67579c5..1499213136 100644 --- a/lib/services/resourceManagement/lib/resource/models/resourceGroupPatchable.js +++ b/lib/services/resourceManagement/lib/resource/models/resourceGroupPatchable.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Resource group information. * diff --git a/lib/services/resourceManagement/lib/resource/models/resourceManagementErrorWithDetails.js b/lib/services/resourceManagement/lib/resource/models/resourceManagementErrorWithDetails.js index f76c620151..2852d51856 100644 --- a/lib/services/resourceManagement/lib/resource/models/resourceManagementErrorWithDetails.js +++ b/lib/services/resourceManagement/lib/resource/models/resourceManagementErrorWithDetails.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The detailed error message of resource management. * diff --git a/lib/services/resourceManagement/lib/resource/models/resourceProviderOperationDisplayProperties.js b/lib/services/resourceManagement/lib/resource/models/resourceProviderOperationDisplayProperties.js index 407cb8d84a..6ffdd933e8 100644 --- a/lib/services/resourceManagement/lib/resource/models/resourceProviderOperationDisplayProperties.js +++ b/lib/services/resourceManagement/lib/resource/models/resourceProviderOperationDisplayProperties.js @@ -20,7 +20,7 @@ class ResourceProviderOperationDisplayProperties { * @member {string} [publisher] Operation description. * @member {string} [provider] Operation provider. * @member {string} [resource] Operation resource. - * @member {string} [operation] Operation. + * @member {string} [operation] Resource provider operation. * @member {string} [description] Operation description. */ constructor() { diff --git a/lib/services/resourceManagement/lib/resource/models/tagDetails.js b/lib/services/resourceManagement/lib/resource/models/tagDetails.js index 7898e8d322..f6762e5341 100644 --- a/lib/services/resourceManagement/lib/resource/models/tagDetails.js +++ b/lib/services/resourceManagement/lib/resource/models/tagDetails.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Tag details. * @@ -47,6 +45,7 @@ class TagDetails { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' diff --git a/lib/services/resourceManagement/lib/resource/models/tagValue.js b/lib/services/resourceManagement/lib/resource/models/tagValue.js index 0436726c6e..6d1ddaec24 100644 --- a/lib/services/resourceManagement/lib/resource/models/tagValue.js +++ b/lib/services/resourceManagement/lib/resource/models/tagValue.js @@ -15,8 +15,9 @@ const models = require('./index'); /** * Tag information. * + * @extends models['BaseResource'] */ -class TagValue { +class TagValue extends models['BaseResource'] { /** * Create a TagValue. * @member {string} [id] The tag ID. @@ -26,6 +27,7 @@ class TagValue { * @member {number} [count.value] Value of count. */ constructor() { + super(); } /** @@ -44,6 +46,7 @@ class TagValue { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' diff --git a/lib/services/resourceManagement/lib/resource/operations/deploymentOperations.js b/lib/services/resourceManagement/lib/resource/operations/deploymentOperations.js index 278d90b590..cb8d1ddea4 100644 --- a/lib/services/resourceManagement/lib/resource/operations/deploymentOperations.js +++ b/lib/services/resourceManagement/lib/resource/operations/deploymentOperations.js @@ -17,9 +17,6 @@ const WebResource = msRest.WebResource; /** * Gets a deployments operation. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * * @param {string} deploymentName The name of the deployment. * * @param {string} operationId The ID of the operation to get. @@ -42,7 +39,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, deploymentName, operationId, options, callback) { +function _getAtSubscriptionScope(deploymentName, operationId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54,23 +51,6 @@ function _get(resourceGroupName, deploymentName, operationId, options, callback) } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); } @@ -106,8 +86,7 @@ function _get(resourceGroupName, deploymentName, operationId, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'; requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -197,9 +176,6 @@ function _get(resourceGroupName, deploymentName, operationId, options, callback) /** * Gets all deployments operations for a deployment. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * * @param {string} deploymentName The name of the deployment with the operation * to get. * @@ -224,7 +200,7 @@ function _get(resourceGroupName, deploymentName, operationId, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _list(resourceGroupName, deploymentName, options, callback) { +function _listAtSubscriptionScope(deploymentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -237,23 +213,6 @@ function _list(resourceGroupName, deploymentName, options, callback) { 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 (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); } @@ -289,8 +248,7 @@ function _list(resourceGroupName, deploymentName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations'; requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -380,10 +338,14 @@ function _list(resourceGroupName, deploymentName, options, callback) { } /** - * Gets all deployments operations for a deployment. + * Gets a deployments operation. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {string} operationId The ID of the operation to get. * * @param {object} [options] Optional Parameters. * @@ -397,14 +359,13 @@ function _list(resourceGroupName, deploymentName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentOperationsListResult} for more - * information. + * See {@link DeploymentOperation} for more information. * * {object} [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) { +function _get(resourceGroupName, deploymentName, operationId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -416,8 +377,48 @@ function _listNext(nextPageLink, options, callback) { } // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -427,8 +428,17 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -492,7 +502,7 @@ function _listNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentOperationsListResult']().mapper(); + let resultMapper = new client.models['DeploymentOperation']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -507,102 +517,721 @@ function _listNext(nextPageLink, options, callback) { }); } -/** Class representing a DeploymentOperations. */ -class DeploymentOperations { - /** - * Create a DeploymentOperations. - * @param {ResourceManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._list = _list; - this._listNext = _listNext; +/** + * Gets all deployments operations for a deployment. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment with the operation + * to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] The number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentOperationsListResult} for more + * information. + * + * {object} [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(resourceGroupName, deploymentName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; } - - /** - * Gets a deployments operation. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {string} operationId The ID of the operation to get. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers 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, deploymentName, operationId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, deploymentName, operationId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); + if (!callback) { + throw new Error('callback cannot be null.'); } - - /** - * Gets a deployments operation. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {string} operationId The ID of the operation to get. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {DeploymentOperation} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentOperation} for more information. - * - * {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, deploymentName, operationId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; + 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 (!optionalCallback) { - return new Promise((resolve, reject) => { - self._get(resourceGroupName, deploymentName, operationId, options, (err, result, request, response) => { - if (err) { reject(err); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.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) { + 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['DeploymentOperationsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all deployments operations for a deployment. + * + * @param {string} nextPageLink The NextLink from the previous 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 DeploymentOperationsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAtSubscriptionScopeNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeploymentOperationsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all deployments operations for a deployment. + * + * @param {string} nextPageLink The NextLink from the previous 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 DeploymentOperationsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeploymentOperationsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 DeploymentOperations. */ +class DeploymentOperations { + /** + * Create a DeploymentOperations. + * @param {ResourceManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getAtSubscriptionScope = _getAtSubscriptionScope; + this._listAtSubscriptionScope = _listAtSubscriptionScope; + this._get = _get; + this._list = _list; + this._listAtSubscriptionScopeNext = _listAtSubscriptionScopeNext; + this._listNext = _listNext; + } + + /** + * Gets a deployments operation. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {string} operationId The ID of the operation to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAtSubscriptionScopeWithHttpOperationResponse(deploymentName, operationId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAtSubscriptionScope(deploymentName, operationId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a deployments operation. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {string} operationId The ID of the operation to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentOperation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAtSubscriptionScope(deploymentName, operationId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAtSubscriptionScope(deploymentName, operationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAtSubscriptionScope(deploymentName, operationId, options, optionalCallback); + } + } + + /** + * Gets all deployments operations for a deployment. + * + * @param {string} deploymentName The name of the deployment with the operation + * to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] The number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAtSubscriptionScopeWithHttpOperationResponse(deploymentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param {string} deploymentName The name of the deployment with the operation + * to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] The number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentOperationsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentOperationsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAtSubscriptionScope(deploymentName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAtSubscriptionScope(deploymentName, options, optionalCallback); + } + } + + /** + * Gets a deployments operation. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {string} operationId The ID of the operation to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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, deploymentName, operationId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, deploymentName, operationId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a deployments operation. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {string} operationId The ID of the operation to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentOperation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentOperation} for more information. + * + * {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, deploymentName, operationId, options, optionalCallback) { + 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, deploymentName, operationId, options, (err, result, request, response) => { + if (err) { reject(err); } else { resolve(result); } return; }); @@ -707,6 +1336,91 @@ class DeploymentOperations { } } + /** + * Gets all deployments operations for a deployment. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAtSubscriptionScopeNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAtSubscriptionScopeNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param {string} nextPageLink The NextLink from the previous 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 {DeploymentOperationsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentOperationsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAtSubscriptionScopeNext(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._listAtSubscriptionScopeNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAtSubscriptionScopeNext(nextPageLink, options, optionalCallback); + } + } + /** * Gets all deployments operations for a deployment. * diff --git a/lib/services/resourceManagement/lib/resource/operations/deployments.js b/lib/services/resourceManagement/lib/resource/operations/deployments.js index 2232d1ec2a..f4b17d475c 100644 --- a/lib/services/resourceManagement/lib/resource/operations/deployments.js +++ b/lib/services/resourceManagement/lib/resource/operations/deployments.js @@ -19,9 +19,8 @@ const WebResource = msRest.WebResource; * @summary Deletes a deployment from the deployment history. * * A template deployment that is currently running cannot be deleted. Deleting - * a template deployment removes the associated deployment operations. Deleting - * a template deployment does not affect the state of the resource group. This - * is an asynchronous operation that returns a status of 202 until the template + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template * deployment is successfully deleted. The Location response header contains * the URI that is used to obtain the status of the process. While the process * is running, a call to the URI in the Location header returns a status of @@ -29,9 +28,6 @@ const WebResource = msRest.WebResource; * status of 204 on success. If the asynchronous request failed, the URI in the * Location header returns an error-level status code. * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to delete. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment to delete. * * @param {object} [options] Optional Parameters. @@ -51,7 +47,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, deploymentName, options, callback) { +function _deleteAtSubscriptionScope(deploymentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64,7 +60,7 @@ function _deleteMethod(resourceGroupName, deploymentName, options, callback) { } // Send request - this.beginDeleteMethod(resourceGroupName, deploymentName, options, (err, parsedResult, httpRequest, response) => { + this.beginDeleteAtSubscriptionScope(deploymentName, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -92,9 +88,6 @@ function _deleteMethod(resourceGroupName, deploymentName, options, callback) { /** * Checks whether the deployment exists. * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to check. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment to check. * * @param {object} [options] Optional Parameters. @@ -114,7 +107,7 @@ function _deleteMethod(resourceGroupName, deploymentName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _checkExistence(resourceGroupName, deploymentName, options, callback) { +function _checkExistenceAtSubscriptionScope(deploymentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -126,23 +119,6 @@ function _checkExistence(resourceGroupName, deploymentName, options, callback) { } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); } @@ -175,8 +151,7 @@ function _checkExistence(resourceGroupName, deploymentName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'; requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -248,19 +223,18 @@ function _checkExistence(resourceGroupName, deploymentName, options, callback) { /** - * @summary Deploys resources to a resource group. + * @summary Deploys resources at subscription scope. * * You can provide the template and parameters directly in the request or link * to JSON files. * - * @param {string} resourceGroupName The name of the resource group to deploy - * the resources to. The name is case insensitive. The resource group must - * already exist. - * * @param {string} deploymentName The name of the deployment. * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -317,6 +291,17 @@ function _checkExistence(resourceGroupName, deploymentName, options, callback) { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -335,7 +320,7 @@ function _checkExistence(resourceGroupName, deploymentName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, deploymentName, parameters, options, callback) { +function _createOrUpdateAtSubscriptionScope(deploymentName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -348,7 +333,7 @@ function _createOrUpdate(resourceGroupName, deploymentName, parameters, options, } // Send request - this.beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateOrUpdateAtSubscriptionScope(deploymentName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -390,9 +375,6 @@ function _createOrUpdate(resourceGroupName, deploymentName, parameters, options, /** * Gets a deployment. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * * @param {string} deploymentName The name of the deployment to get. * * @param {object} [options] Optional Parameters. @@ -413,7 +395,7 @@ function _createOrUpdate(resourceGroupName, deploymentName, parameters, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, deploymentName, options, callback) { +function _getAtSubscriptionScope(deploymentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -425,23 +407,6 @@ function _get(resourceGroupName, deploymentName, options, callback) { } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); } @@ -474,8 +439,7 @@ function _get(resourceGroupName, deploymentName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'; requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -567,10 +531,7 @@ function _get(resourceGroupName, deploymentName, options, callback) { * You can cancel a deployment only if the provisioningState is Accepted or * Running. After the deployment is canceled, the provisioningState is set to * Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. + * template deployment and leaves the resources partially deployed. * * @param {string} deploymentName The name of the deployment to cancel. * @@ -591,7 +552,7 @@ function _get(resourceGroupName, deploymentName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _cancel(resourceGroupName, deploymentName, options, callback) { +function _cancelAtSubscriptionScope(deploymentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -603,23 +564,6 @@ function _cancel(resourceGroupName, deploymentName, options, callback) { } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); } @@ -652,8 +596,7 @@ function _cancel(resourceGroupName, deploymentName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'; requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -726,13 +669,13 @@ function _cancel(resourceGroupName, deploymentName, options, callback) { * Validates whether the specified template is syntactically correct and will * be accepted by Azure Resource Manager.. * - * @param {string} resourceGroupName The name of the resource group the - * template will be deployed to. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment. * * @param {object} parameters Parameters to validate. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -789,6 +732,17 @@ function _cancel(resourceGroupName, deploymentName, options, callback) { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -808,7 +762,7 @@ function _cancel(resourceGroupName, deploymentName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _validate(resourceGroupName, deploymentName, parameters, options, callback) { +function _validateAtSubscriptionScope(deploymentName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -820,23 +774,6 @@ function _validate(resourceGroupName, deploymentName, parameters, options, callb } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); } @@ -872,8 +809,7 @@ function _validate(resourceGroupName, deploymentName, parameters, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'; requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -993,9 +929,6 @@ function _validate(resourceGroupName, deploymentName, parameters, options, callb /** * Exports the template used for specified deployment. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * * @param {string} deploymentName The name of the deployment from which to get * the template. * @@ -1018,7 +951,7 @@ function _validate(resourceGroupName, deploymentName, parameters, options, callb * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _exportTemplate(resourceGroupName, deploymentName, options, callback) { +function _exportTemplateAtSubscriptionScope(deploymentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1030,23 +963,6 @@ function _exportTemplate(resourceGroupName, deploymentName, options, callback) { } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); } @@ -1079,8 +995,7 @@ function _exportTemplate(resourceGroupName, deploymentName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'; requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -1167,10 +1082,7 @@ function _exportTemplate(resourceGroupName, deploymentName, options, callback) { } /** - * Get all the deployments for a resource group. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployments to get. The name is case insensitive. + * Get all the deployments for a subscription. * * @param {object} [options] Optional Parameters. * @@ -1196,7 +1108,7 @@ function _exportTemplate(resourceGroupName, deploymentName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByResourceGroup(resourceGroupName, options, callback) { +function _listAtSubscriptionScope(options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1210,23 +1122,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter must be of type string.'); } @@ -1248,8 +1143,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (filter !== null && filter !== undefined) { @@ -1340,6 +1234,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { }); } + /** * @summary Deletes a deployment from the deployment history. * @@ -1376,7 +1271,70 @@ function _listByResourceGroup(resourceGroupName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginDeleteMethod(resourceGroupName, deploymentName, options, callback) { +function _deleteMethod(resourceGroupName, deploymentName, options, callback) { + /* jshint 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, deploymentName, 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); + }); + }); +} + +/** + * Checks whether the deployment exists. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployment to check. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment to check. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {boolean} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkExistence(resourceGroupName, deploymentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1449,7 +1407,7 @@ function _beginDeleteMethod(resourceGroupName, deploymentName, options, callback // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'HEAD'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1474,7 +1432,7 @@ function _beginDeleteMethod(resourceGroupName, deploymentName, options, callback return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1502,11 +1460,13 @@ function _beginDeleteMethod(resourceGroupName, deploymentName, options, callback // Create Result let result = null; if (responseBody === '') responseBody = null; + result = (statusCode === 204); return callback(null, result, httpRequest, response); }); } + /** * @summary Deploys resources to a resource group. * @@ -1521,6 +1481,9 @@ function _beginDeleteMethod(resourceGroupName, deploymentName, options, callback * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -1577,6 +1540,17 @@ function _beginDeleteMethod(resourceGroupName, deploymentName, options, callback * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1595,30 +1569,108 @@ function _beginDeleteMethod(resourceGroupName, deploymentName, options, callback * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, options, callback) { +function _createOrUpdate(resourceGroupName, deploymentName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeploymentExtended']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a deployment. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExtended} for more information. + * + * {object} [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, deploymentName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); @@ -1641,9 +1693,6 @@ function _beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, opt throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); } } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -1671,7 +1720,7 @@ function _beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, opt // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1689,28 +1738,14 @@ function _beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, opt } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['Deployment']().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; + 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) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1755,33 +1790,23 @@ function _beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, opt 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['DeploymentExtended']().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); }); } /** - * Get all the deployments for a resource group. + * @summary Cancels a currently running template deployment. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * You can cancel a deployment only if the provisioningState is Accepted or + * Running. After the deployment is canceled, the provisioningState is set to + * Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment to cancel. * * @param {object} [options] Optional Parameters. * @@ -1794,14 +1819,13 @@ function _beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, opt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentListResult} for more information. + * {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 _listByResourceGroupNext(nextPageLink, options, callback) { +function _cancel(resourceGroupName, deploymentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1813,8 +1837,45 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1824,12 +1885,20 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1854,7 +1923,7 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1882,47 +1951,2776 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred 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 Deployments. */ -class Deployments { - /** - * Create a Deployments. - * @param {ResourceManagementClient} client Reference to the service client. +/** + * Validates whether the specified template is syntactically correct and will + * be accepted by Azure Resource Manager.. + * + * @param {string} resourceGroupName The name of the resource group the + * template will be deployed to. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Parameters to validate. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentValidateResult} for more + * information. + * + * {object} [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, deploymentName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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['Deployment']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 400) { + let error = new Error(responseBody); + error.statusCode = response.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['DeploymentValidateResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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 === 400) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeploymentValidateResult']().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); + }); +} + +/** + * Exports the template used for specified deployment. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment from which to get + * the template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExportResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _exportTemplate(resourceGroupName, deploymentName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeploymentExportResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get all the deployments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployments to get. The name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + * + * @param {number} [options.top] The number of results to get. If null is + * passed, returns all deployments. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentListResult} for more information. + * + * {object} [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 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.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) { + 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['DeploymentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _beginDeleteAtSubscriptionScope(deploymentName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'; + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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) { + let error = new Error(responseBody); + error.statusCode = response.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 Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link + * to JSON files. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Additional parameters supplied to the operation. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExtended} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdateAtSubscriptionScope(deploymentName, 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 (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'; + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Deployment']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.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['DeploymentExtended']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['DeploymentExtended']().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 Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. Deleting + * a template deployment does not affect the state of the resource group. This + * is an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployment to delete. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, deploymentName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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) { + let error = new Error(responseBody); + error.statusCode = response.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 Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link + * to JSON files. + * + * @param {string} resourceGroupName The name of the resource group to deploy + * the resources to. The name is case insensitive. The resource group must + * already exist. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Additional parameters supplied to the operation. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExtended} for more information. + * + * {object} [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, deploymentName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (deploymentName !== null && deploymentName !== undefined) { + if (deploymentName.length > 64) + { + throw new Error('"deploymentName" should satisfy the constraint - "MaxLength": 64'); + } + if (deploymentName.length < 1) + { + throw new Error('"deploymentName" should satisfy the constraint - "MinLength": 1'); + } + if (deploymentName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"deploymentName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{deploymentName}', encodeURIComponent(deploymentName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Deployment']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.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['DeploymentExtended']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['DeploymentExtended']().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); + }); +} + +/** + * Get all the deployments 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 DeploymentListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAtSubscriptionScopeNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeploymentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get all the deployments for 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 DeploymentListResult} for more information. + * + * {object} [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) { + 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['DeploymentListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Deployments. */ +class Deployments { + /** + * Create a Deployments. + * @param {ResourceManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteAtSubscriptionScope = _deleteAtSubscriptionScope; + this._checkExistenceAtSubscriptionScope = _checkExistenceAtSubscriptionScope; + this._createOrUpdateAtSubscriptionScope = _createOrUpdateAtSubscriptionScope; + this._getAtSubscriptionScope = _getAtSubscriptionScope; + this._cancelAtSubscriptionScope = _cancelAtSubscriptionScope; + this._validateAtSubscriptionScope = _validateAtSubscriptionScope; + this._exportTemplateAtSubscriptionScope = _exportTemplateAtSubscriptionScope; + this._listAtSubscriptionScope = _listAtSubscriptionScope; + this._deleteMethod = _deleteMethod; + this._checkExistence = _checkExistence; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._cancel = _cancel; + this._validate = _validate; + this._exportTemplate = _exportTemplate; + this._listByResourceGroup = _listByResourceGroup; + this._beginDeleteAtSubscriptionScope = _beginDeleteAtSubscriptionScope; + this._beginCreateOrUpdateAtSubscriptionScope = _beginCreateOrUpdateAtSubscriptionScope; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listAtSubscriptionScopeNext = _listAtSubscriptionScopeNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * @summary Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteAtSubscriptionScopeWithHttpOperationResponse(deploymentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteAtSubscriptionScope(deploymentName, 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 deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + deleteAtSubscriptionScope(deploymentName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteAtSubscriptionScope(deploymentName, options, optionalCallback); + } + } + + /** + * Checks whether the deployment exists. + * + * @param {string} deploymentName The name of the deployment to check. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + checkExistenceAtSubscriptionScopeWithHttpOperationResponse(deploymentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkExistenceAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Checks whether the deployment exists. + * + * @param {string} deploymentName The name of the deployment to check. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Boolean} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {boolean} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkExistenceAtSubscriptionScope(deploymentName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._checkExistenceAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkExistenceAtSubscriptionScope(deploymentName, options, optionalCallback); + } + } + + /** + * @summary Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link + * to JSON files. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Additional parameters supplied to the operation. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateAtSubscriptionScopeWithHttpOperationResponse(deploymentName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateAtSubscriptionScope(deploymentName, 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 Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link + * to JSON files. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Additional parameters supplied to the operation. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentExtended} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExtended} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateAtSubscriptionScope(deploymentName, 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._createOrUpdateAtSubscriptionScope(deploymentName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateAtSubscriptionScope(deploymentName, parameters, options, optionalCallback); + } + } + + /** + * Gets a deployment. + * + * @param {string} deploymentName The name of the deployment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAtSubscriptionScopeWithHttpOperationResponse(deploymentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a deployment. + * + * @param {string} deploymentName The name of the deployment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentExtended} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExtended} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAtSubscriptionScope(deploymentName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAtSubscriptionScope(deploymentName, options, optionalCallback); + } + } + + /** + * @summary Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or + * Running. After the deployment is canceled, the provisioningState is set to + * Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param {string} deploymentName The name of the deployment to cancel. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + cancelAtSubscriptionScopeWithHttpOperationResponse(deploymentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancelAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or + * Running. After the deployment is canceled, the provisioningState is set to + * Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param {string} deploymentName The name of the deployment to cancel. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + cancelAtSubscriptionScope(deploymentName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._cancelAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancelAtSubscriptionScope(deploymentName, options, optionalCallback); + } + } + + /** + * Validates whether the specified template is syntactically correct and will + * be accepted by Azure Resource Manager.. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Parameters to validate. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + validateAtSubscriptionScopeWithHttpOperationResponse(deploymentName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._validateAtSubscriptionScope(deploymentName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Validates whether the specified template is syntactically correct and will + * be accepted by Azure Resource Manager.. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Parameters to validate. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentValidateResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentValidateResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + validateAtSubscriptionScope(deploymentName, 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._validateAtSubscriptionScope(deploymentName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._validateAtSubscriptionScope(deploymentName, parameters, options, optionalCallback); + } + } + + /** + * Exports the template used for specified deployment. + * + * @param {string} deploymentName The name of the deployment from which to get + * the template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + exportTemplateAtSubscriptionScopeWithHttpOperationResponse(deploymentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._exportTemplateAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Exports the template used for specified deployment. + * + * @param {string} deploymentName The name of the deployment from which to get + * the template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentExportResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExportResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + exportTemplateAtSubscriptionScope(deploymentName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._exportTemplateAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._exportTemplateAtSubscriptionScope(deploymentName, options, optionalCallback); + } + } + + /** + * Get all the deployments for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + * + * @param {number} [options.top] The number of results to get. If null is + * passed, returns all deployments. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAtSubscriptionScopeWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAtSubscriptionScope(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get all the deployments for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + * + * @param {number} [options.top] The number of results to get. If null is + * passed, returns all deployments. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._checkExistence = _checkExistence; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._cancel = _cancel; - this._validate = _validate; - this._exportTemplate = _exportTemplate; - this._listByResourceGroup = _listByResourceGroup; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listByResourceGroupNext = _listByResourceGroupNext; + listAtSubscriptionScope(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listAtSubscriptionScope(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAtSubscriptionScope(options, optionalCallback); + } } /** @@ -2135,6 +4933,9 @@ class Deployments { * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -2191,6 +4992,17 @@ class Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2230,6 +5042,9 @@ class Deployments { * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -2286,6 +5101,17 @@ class Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2529,6 +5355,9 @@ class Deployments { * * @param {object} parameters Parameters to validate. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -2585,6 +5414,17 @@ class Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2621,6 +5461,9 @@ class Deployments { * * @param {object} parameters Parameters to validate. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -2677,6 +5520,17 @@ class Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2765,8 +5619,207 @@ class Deployments { * @param {string} resourceGroupName The name of the resource group. The name * is case insensitive. * - * @param {string} deploymentName The name of the deployment from which to get - * the template. + * @param {string} deploymentName The name of the deployment from which to get + * the template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentExportResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExportResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + exportTemplate(resourceGroupName, deploymentName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._exportTemplate(resourceGroupName, deploymentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._exportTemplate(resourceGroupName, deploymentName, options, optionalCallback); + } + } + + /** + * Get all the deployments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployments to get. The name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + * + * @param {number} [options.top] The number of results to get. If null is + * passed, returns all deployments. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Get all the deployments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployments to get. The name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + * + * @param {number} [options.top] The number of results to get. If null is + * passed, returns all deployments. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeploymentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentListResult} for more information. + * + * {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 Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteAtSubscriptionScopeWithHttpOperationResponse(deploymentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteAtSubscriptionScope(deploymentName, 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 deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} deploymentName The name of the deployment to delete. * * @param {object} [options] Optional Parameters. * @@ -2780,7 +5833,7 @@ class Deployments { * * {Promise} A promise is returned * - * @resolve {DeploymentExportResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2788,15 +5841,13 @@ class Deployments { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentExportResult} for more - * information. + * {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. */ - exportTemplate(resourceGroupName, deploymentName, options, optionalCallback) { + beginDeleteAtSubscriptionScope(deploymentName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2805,45 +5856,113 @@ class Deployments { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._exportTemplate(resourceGroupName, deploymentName, options, (err, result, request, response) => { + self._beginDeleteAtSubscriptionScope(deploymentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._exportTemplate(resourceGroupName, deploymentName, options, optionalCallback); + return self._beginDeleteAtSubscriptionScope(deploymentName, options, optionalCallback); } } /** - * Get all the deployments for a resource group. + * @summary Deploys resources at subscription scope. * - * @param {string} resourceGroupName The name of the resource group with the - * deployments to get. The name is case insensitive. + * You can provide the template and parameters directly in the request or link + * to JSON files. * - * @param {object} [options] Optional Parameters. + * @param {string} deploymentName The name of the deployment. * - * @param {string} [options.filter] The filter to apply on the operation. For - * example, you can use $filter=provisioningState eq '{state}'. + * @param {object} parameters Additional parameters supplied to the operation. * - * @param {number} [options.top] The number of results to get. If null is - * passed, returns all deployments. + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + beginCreateOrUpdateAtSubscriptionScopeWithHttpOperationResponse(deploymentName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + self._beginCreateOrUpdateAtSubscriptionScope(deploymentName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2854,18 +5973,86 @@ class Deployments { } /** - * Get all the deployments for a resource group. + * @summary Deploys resources at subscription scope. * - * @param {string} resourceGroupName The name of the resource group with the - * deployments to get. The name is case insensitive. + * You can provide the template and parameters directly in the request or link + * to JSON files. * - * @param {object} [options] Optional Parameters. + * @param {string} deploymentName The name of the deployment. * - * @param {string} [options.filter] The filter to apply on the operation. For - * example, you can use $filter=provisioningState eq '{state}'. + * @param {object} parameters Additional parameters supplied to the operation. * - * @param {number} [options.top] The number of results to get. If null is - * passed, returns all deployments. + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2877,7 +6064,7 @@ class Deployments { * * {Promise} A promise is returned * - * @resolve {DeploymentListResult} - The deserialized result object. + * @resolve {DeploymentExtended} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2886,13 +6073,13 @@ class Deployments { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentListResult} for more information. + * See {@link DeploymentExtended} for more information. * * {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) { + beginCreateOrUpdateAtSubscriptionScope(deploymentName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2901,14 +6088,14 @@ class Deployments { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + self._beginCreateOrUpdateAtSubscriptionScope(deploymentName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + return self._beginCreateOrUpdateAtSubscriptionScope(deploymentName, parameters, options, optionalCallback); } } @@ -3035,6 +6222,9 @@ class Deployments { * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -3091,6 +6281,17 @@ class Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3130,6 +6331,9 @@ class Deployments { * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -3186,6 +6390,17 @@ class Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3233,6 +6448,90 @@ class Deployments { } } + /** + * Get all the deployments 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. + */ + listAtSubscriptionScopeNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAtSubscriptionScopeNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get all the deployments 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 {DeploymentListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAtSubscriptionScopeNext(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._listAtSubscriptionScopeNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAtSubscriptionScopeNext(nextPageLink, options, optionalCallback); + } + } + /** * Get all the deployments for a resource group. * diff --git a/lib/services/resourceManagement/lib/resource/operations/index.d.ts b/lib/services/resourceManagement/lib/resource/operations/index.d.ts index 2a8e41ce8b..735a29ab74 100644 --- a/lib/services/resourceManagement/lib/resource/operations/index.d.ts +++ b/lib/services/resourceManagement/lib/resource/operations/index.d.ts @@ -12,6 +12,123 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ResourceManagementClient. + */ +export interface Operations { + + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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; + + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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 * Deployments @@ -25,9 +142,8 @@ export interface Deployments { * @summary Deletes a deployment from the deployment history. * * A template deployment that is currently running cannot be deleted. Deleting - * a template deployment removes the associated deployment operations. Deleting - * a template deployment does not affect the state of the resource group. This - * is an asynchronous operation that returns a status of 202 until the template + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template * deployment is successfully deleted. The Location response header contains * the URI that is used to obtain the status of the process. While the process * is running, a call to the URI in the Location header returns a status of @@ -35,9 +151,6 @@ export interface Deployments { * status of 204 on success. If the asynchronous request failed, the URI in the * Location header returns an error-level status code. * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to delete. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment to delete. * * @param {object} [options] Optional Parameters. @@ -51,15 +164,14 @@ export interface Deployments { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Deletes a deployment from the deployment history. * * A template deployment that is currently running cannot be deleted. Deleting - * a template deployment removes the associated deployment operations. Deleting - * a template deployment does not affect the state of the resource group. This - * is an asynchronous operation that returns a status of 202 until the template + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template * deployment is successfully deleted. The Location response header contains * the URI that is used to obtain the status of the process. While the process * is running, a call to the URI in the Location header returns a status of @@ -67,9 +179,6 @@ export interface Deployments { * status of 204 on success. If the asynchronous request failed, the URI in the * Location header returns an error-level status code. * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to delete. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment to delete. * * @param {object} [options] Optional Parameters. @@ -98,17 +207,14 @@ export interface Deployments { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteAtSubscriptionScope(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteAtSubscriptionScope(deploymentName: string, callback: ServiceCallback): void; + deleteAtSubscriptionScope(deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Checks whether the deployment exists. * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to check. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment to check. * * @param {object} [options] Optional Parameters. @@ -122,14 +228,11 @@ export interface Deployments { * * @reject {Error|ServiceError} - The error object. */ - checkExistenceWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + checkExistenceAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Checks whether the deployment exists. * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to check. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment to check. * * @param {object} [options] Optional Parameters. @@ -158,25 +261,24 @@ export interface Deployments { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - checkExistence(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkExistence(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - checkExistence(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + checkExistenceAtSubscriptionScope(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkExistenceAtSubscriptionScope(deploymentName: string, callback: ServiceCallback): void; + checkExistenceAtSubscriptionScope(deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Deploys resources to a resource group. + * @summary Deploys resources at subscription scope. * * You can provide the template and parameters directly in the request or link * to JSON files. * - * @param {string} resourceGroupName The name of the resource group to deploy - * the resources to. The name is case insensitive. The resource group must - * already exist. - * * @param {string} deploymentName The name of the deployment. * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -233,6 +335,17 @@ export interface Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -244,22 +357,21 @@ export interface Deployments { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Deploys resources to a resource group. + * @summary Deploys resources at subscription scope. * * You can provide the template and parameters directly in the request or link * to JSON files. * - * @param {string} resourceGroupName The name of the resource group to deploy - * the resources to. The name is case insensitive. The resource group must - * already exist. - * * @param {string} deploymentName The name of the deployment. * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -316,6 +428,17 @@ export interface Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -343,17 +466,14 @@ export interface Deployments { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; + createOrUpdateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Gets a deployment. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * * @param {string} deploymentName The name of the deployment to get. * * @param {object} [options] Optional Parameters. @@ -367,14 +487,11 @@ export interface Deployments { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets a deployment. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * * @param {string} deploymentName The name of the deployment to get. * * @param {object} [options] Optional Parameters. @@ -404,9 +521,9 @@ export interface Deployments { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getAtSubscriptionScope(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAtSubscriptionScope(deploymentName: string, callback: ServiceCallback): void; + getAtSubscriptionScope(deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -415,10 +532,7 @@ export interface Deployments { * You can cancel a deployment only if the provisioningState is Accepted or * Running. After the deployment is canceled, the provisioningState is set to * Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. + * template deployment and leaves the resources partially deployed. * * @param {string} deploymentName The name of the deployment to cancel. * @@ -433,7 +547,7 @@ export interface Deployments { * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Cancels a currently running template deployment. @@ -441,10 +555,7 @@ export interface Deployments { * You can cancel a deployment only if the provisioningState is Accepted or * Running. After the deployment is canceled, the provisioningState is set to * Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. + * template deployment and leaves the resources partially deployed. * * @param {string} deploymentName The name of the deployment to cancel. * @@ -474,22 +585,22 @@ export interface Deployments { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancel(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancelAtSubscriptionScope(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancelAtSubscriptionScope(deploymentName: string, callback: ServiceCallback): void; + cancelAtSubscriptionScope(deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Validates whether the specified template is syntactically correct and will * be accepted by Azure Resource Manager.. * - * @param {string} resourceGroupName The name of the resource group the - * template will be deployed to. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment. * * @param {object} parameters Parameters to validate. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -546,6 +657,17 @@ export interface Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -557,19 +679,19 @@ export interface Deployments { * * @reject {Error|ServiceError} - The error object. */ - validateWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + validateAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Validates whether the specified template is syntactically correct and will * be accepted by Azure Resource Manager.. * - * @param {string} resourceGroupName The name of the resource group the - * template will be deployed to. The name is case insensitive. - * * @param {string} deploymentName The name of the deployment. * * @param {object} parameters Parameters to validate. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -626,6 +748,17 @@ export interface Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -654,17 +787,14 @@ export interface Deployments { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - validate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - validate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; - validate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + validateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; + validateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Exports the template used for specified deployment. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * * @param {string} deploymentName The name of the deployment from which to get * the template. * @@ -679,14 +809,11 @@ export interface Deployments { * * @reject {Error|ServiceError} - The error object. */ - exportTemplateWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + exportTemplateAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Exports the template used for specified deployment. * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * * @param {string} deploymentName The name of the deployment from which to get * the template. * @@ -718,16 +845,13 @@ export interface Deployments { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - exportTemplate(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportTemplate(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - exportTemplate(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + exportTemplateAtSubscriptionScope(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportTemplateAtSubscriptionScope(deploymentName: string, callback: ServiceCallback): void; + exportTemplateAtSubscriptionScope(deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Get all the deployments for a resource group. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployments to get. The name is case insensitive. + * Get all the deployments for a subscription. * * @param {object} [options] Optional Parameters. * @@ -746,13 +870,10 @@ export interface Deployments { * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + listAtSubscriptionScopeWithHttpOperationResponse(options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Get all the deployments for a resource group. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployments to get. The name is case insensitive. + * Get all the deployments for a subscription. * * @param {object} [options] Optional Parameters. * @@ -772,7 +893,1113 @@ export interface Deployments { * * {Promise} A promise is returned. * - * @resolve {DeploymentListResult} - The deserialized result object. + * @resolve {DeploymentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listAtSubscriptionScope(options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listAtSubscriptionScope(callback: ServiceCallback): void; + listAtSubscriptionScope(options: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. Deleting + * a template deployment does not affect the state of the resource group. This + * is an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployment to delete. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. Deleting + * a template deployment does not affect the state of the resource group. This + * is an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployment to delete. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Checks whether the deployment exists. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployment to check. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment to check. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + checkExistenceWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Checks whether the deployment exists. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployment to check. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment to check. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Boolean} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Boolean} [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. + */ + checkExistence(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkExistence(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; + checkExistence(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link + * to JSON files. + * + * @param {string} resourceGroupName The name of the resource group to deploy + * the resources to. The name is case insensitive. The resource group must + * already exist. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Additional parameters supplied to the operation. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link + * to JSON files. + * + * @param {string} resourceGroupName The name of the resource group to deploy + * the resources to. The name is case insensitive. The resource group must + * already exist. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Additional parameters supplied to the operation. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeploymentExtended} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentExtended} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExtended} for more information. + * + * {WebResource} [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, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a deployment. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a deployment. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeploymentExtended} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentExtended} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExtended} for more information. + * + * {WebResource} [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, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or + * Running. After the deployment is canceled, the provisioningState is set to + * Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment to cancel. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or + * Running. After the deployment is canceled, the provisioningState is set to + * Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment to cancel. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + cancel(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Validates whether the specified template is syntactically correct and will + * be accepted by Azure Resource Manager.. + * + * @param {string} resourceGroupName The name of the resource group the + * template will be deployed to. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Parameters to validate. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Validates whether the specified template is syntactically correct and will + * be accepted by Azure Resource Manager.. + * + * @param {string} resourceGroupName The name of the resource group the + * template will be deployed to. The name is case insensitive. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Parameters to validate. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeploymentValidateResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentValidateResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentValidateResult} for more + * information. + * + * {WebResource} [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, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; + validate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Exports the template used for specified deployment. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment from which to get + * the template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + exportTemplateWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Exports the template used for specified deployment. + * + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. + * + * @param {string} deploymentName The name of the deployment from which to get + * the template. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeploymentExportResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentExportResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExportResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + exportTemplate(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportTemplate(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; + exportTemplate(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get all the deployments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployments to get. The name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + * + * @param {number} [options.top] The number of results to get. If null is + * passed, returns all deployments. + * + * @param {object} [options.customHeaders] Headers that 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?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get all the deployments for a resource group. + * + * @param {string} resourceGroupName The name of the resource group with the + * deployments to get. The name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + * + * @param {number} [options.top] The number of results to get. If null is + * passed, returns all deployments. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeploymentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentListResult} for more information. + * + * {WebResource} [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?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting + * a template deployment removes the associated deployment operations. This is + * an asynchronous operation that returns a status of 202 until the template + * deployment is successfully deleted. The Location response header contains + * the URI that is used to obtain the status of the process. While the process + * is running, a call to the URI in the Location header returns a status of + * 202. When the process finishes, the URI in the Location header returns a + * status of 204 on success. If the asynchronous request failed, the URI in the + * Location header returns an error-level status code. + * + * @param {string} deploymentName The name of the deployment to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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. + */ + beginDeleteAtSubscriptionScope(deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteAtSubscriptionScope(deploymentName: string, callback: ServiceCallback): void; + beginDeleteAtSubscriptionScope(deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link + * to JSON files. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Additional parameters supplied to the operation. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link + * to JSON files. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {object} parameters Additional parameters supplied to the operation. + * + * @param {string} [parameters.location] The location to store the deployment + * data. + * + * @param {object} parameters.properties The deployment properties. + * + * @param {object} [parameters.properties.template] The template content. You + * use this element when you want to pass the template syntax directly in the + * request rather than link to an existing template. It can be a JObject or + * well-formed JSON string. Use either the templateLink property or the + * template property, but not both. + * + * @param {object} [parameters.properties.templateLink] The URI of the + * template. Use either the templateLink property or the template property, but + * not both. + * + * @param {string} parameters.properties.templateLink.uri The URI of the + * template to deploy. + * + * @param {string} [parameters.properties.templateLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {object} [parameters.properties.parameters] Name and value pairs that + * define the deployment parameters for the template. You use this element when + * you want to provide the parameter values directly in the request rather than + * link to an existing parameter file. Use either the parametersLink property + * or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + * + * @param {object} [parameters.properties.parametersLink] The URI of parameters + * file. You use this element to link to an existing parameters file. Use + * either the parametersLink property or the parameters property, but not both. + * + * @param {string} parameters.properties.parametersLink.uri The URI of the + * parameters file. + * + * @param {string} [parameters.properties.parametersLink.contentVersion] If + * included, must match the ContentVersion in the template. + * + * @param {string} parameters.properties.mode The mode that is used to deploy + * resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are + * not included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + * + * @param {object} [parameters.properties.debugSetting] The debug setting of + * the deployment. + * + * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies + * the type of information to log for debugging. The permitted values are none, + * requestContent, responseContent, or both requestContent and responseContent + * separated by a comma. The default is none. When setting this value, + * carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could + * potentially expose sensitive data that is retrieved through the deployment + * operations. + * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeploymentExtended} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -780,16 +2007,16 @@ export interface Deployments { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DeploymentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentListResult} for more information. + * {DeploymentExtended} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentExtended} for more information. * * {WebResource} [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?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; + beginCreateOrUpdateAtSubscriptionScope(deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -888,6 +2115,9 @@ export interface Deployments { * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -944,6 +2174,17 @@ export interface Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -971,6 +2212,9 @@ export interface Deployments { * * @param {object} parameters Additional parameters supplied to the operation. * + * @param {string} [parameters.location] The location to store the deployment + * data. + * * @param {object} parameters.properties The deployment properties. * * @param {object} [parameters.properties.template] The template content. You @@ -1027,6 +2271,17 @@ export interface Deployments { * potentially expose sensitive data that is retrieved through the deployment * operations. * + * @param {object} [parameters.properties.onErrorDeployment] The deployment on + * error behavior. + * + * @param {string} [parameters.properties.onErrorDeployment.type] The + * deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. Possible values include: 'LastSuccessful', + * 'SpecificDeployment' + * + * @param {string} [parameters.properties.onErrorDeployment.deploymentName] The + * deployment to be used on error case. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1059,6 +2314,63 @@ export interface Deployments { beginCreateOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Get all the deployments 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. + */ + listAtSubscriptionScopeNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get all the deployments 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 {DeploymentListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listAtSubscriptionScopeNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAtSubscriptionScopeNext(nextPageLink: string, callback: ServiceCallback): void; + listAtSubscriptionScopeNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Get all the deployments for a resource group. * @@ -1950,7 +3262,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2024,7 +3342,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2117,7 +3441,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2191,7 +3521,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2479,7 +3815,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2545,7 +3887,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2630,7 +3978,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2696,7 +4050,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3096,7 +4456,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3170,7 +4536,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3263,7 +4635,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3337,7 +4715,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3484,7 +4868,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3550,7 +4940,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3635,7 +5031,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3701,7 +5103,13 @@ export interface Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3927,8 +5335,6 @@ export interface ResourceGroups { * @param {object} parameters Parameters supplied to the create or update a * resource group. * - * @param {string} [parameters.name] The name of the resource group. - * * @param {object} [parameters.properties] * * @param {string} parameters.location The location of the resource group. It @@ -3962,8 +5368,6 @@ export interface ResourceGroups { * @param {object} parameters Parameters supplied to the create or update a * resource group. * - * @param {string} [parameters.name] The name of the resource group. - * * @param {object} [parameters.properties] * * @param {string} parameters.location The location of the resource group. It @@ -4845,6 +6249,127 @@ export interface Tags { export interface DeploymentOperations { + /** + * Gets a deployments operation. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {string} operationId The ID of the operation to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a deployments operation. + * + * @param {string} deploymentName The name of the deployment. + * + * @param {string} operationId The ID of the operation to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeploymentOperation} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentOperation} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentOperation} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAtSubscriptionScope(deploymentName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAtSubscriptionScope(deploymentName: string, operationId: string, callback: ServiceCallback): void; + getAtSubscriptionScope(deploymentName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all deployments operations for a deployment. + * + * @param {string} deploymentName The name of the deployment with the operation + * to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] The number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAtSubscriptionScopeWithHttpOperationResponse(deploymentName: string, options?: { top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all deployments operations for a deployment. + * + * @param {string} deploymentName The name of the deployment with the operation + * to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] The number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeploymentOperationsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentOperationsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentOperationsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listAtSubscriptionScope(deploymentName: string, options?: { top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listAtSubscriptionScope(deploymentName: string, callback: ServiceCallback): void; + listAtSubscriptionScope(deploymentName: string, options: { top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Gets a deployments operation. * @@ -4978,6 +6503,64 @@ export interface DeploymentOperations { list(resourceGroupName: string, deploymentName: string, options: { top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Gets all deployments operations for a deployment. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAtSubscriptionScopeNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all deployments operations for a deployment. + * + * @param {string} nextPageLink The NextLink from the 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 {DeploymentOperationsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeploymentOperationsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentOperationsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listAtSubscriptionScopeNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAtSubscriptionScopeNext(nextPageLink: string, callback: ServiceCallback): void; + listAtSubscriptionScopeNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Gets all deployments operations for a deployment. * diff --git a/lib/services/resourceManagement/lib/resource/operations/index.js b/lib/services/resourceManagement/lib/resource/operations/index.js index 08ce2f634a..50332d8046 100644 --- a/lib/services/resourceManagement/lib/resource/operations/index.js +++ b/lib/services/resourceManagement/lib/resource/operations/index.js @@ -14,6 +14,7 @@ 'use strict'; +exports.Operations = require('./operations'); exports.Deployments = require('./deployments'); exports.Providers = require('./providers'); exports.Resources = require('./resources'); diff --git a/lib/services/resourceManagement/lib/resource/operations/operations.js b/lib/services/resourceManagement/lib/resource/operations/operations.js new file mode 100644 index 0000000000..75d79e58fc --- /dev/null +++ b/lib/services/resourceManagement/lib/resource/operations/operations.js @@ -0,0 +1,449 @@ +/* + * 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; + +/** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {object} [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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.Resources/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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Operations. */ +class Operations { + /** + * Create a Operations. + * @param {ResourceManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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); + } + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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 = Operations; diff --git a/lib/services/resourceManagement/lib/resource/operations/resourceGroups.js b/lib/services/resourceManagement/lib/resource/operations/resourceGroups.js index 46fb19a93f..9430b89bc6 100644 --- a/lib/services/resourceManagement/lib/resource/operations/resourceGroups.js +++ b/lib/services/resourceManagement/lib/resource/operations/resourceGroups.js @@ -160,8 +160,6 @@ function _checkExistence(resourceGroupName, options, callback) { * @param {object} parameters Parameters supplied to the create or update a * resource group. * - * @param {string} [parameters.name] The name of the resource group. - * * @param {object} [parameters.properties] * * @param {string} parameters.location The location of the resource group. It @@ -1475,8 +1473,6 @@ class ResourceGroups { * @param {object} parameters Parameters supplied to the create or update a * resource group. * - * @param {string} [parameters.name] The name of the resource group. - * * @param {object} [parameters.properties] * * @param {string} parameters.location The location of the resource group. It @@ -1522,8 +1518,6 @@ class ResourceGroups { * @param {object} parameters Parameters supplied to the create or update a * resource group. * - * @param {string} [parameters.name] The name of the resource group. - * * @param {object} [parameters.properties] * * @param {string} parameters.location The location of the resource group. It diff --git a/lib/services/resourceManagement/lib/resource/operations/resources.js b/lib/services/resourceManagement/lib/resource/operations/resources.js index 4c4a91a30a..6c6d5f2ac0 100644 --- a/lib/services/resourceManagement/lib/resource/operations/resources.js +++ b/lib/services/resourceManagement/lib/resource/operations/resources.js @@ -802,7 +802,13 @@ function _deleteMethod(resourceGroupName, resourceProviderNamespace, parentResou * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -934,7 +940,13 @@ function _createOrUpdate(resourceGroupName, resourceProviderNamespace, parentRes * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -1426,7 +1438,13 @@ function _deleteById(resourceId, apiVersion, options, callback) { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -1550,7 +1568,13 @@ function _createOrUpdateById(resourceId, apiVersion, parameters, options, callba * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2316,7 +2340,13 @@ function _beginDeleteMethod(resourceGroupName, resourceProviderNamespace, parent * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2575,7 +2605,13 @@ function _beginCreateOrUpdate(resourceGroupName, resourceProviderNamespace, pare * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -2930,7 +2966,13 @@ function _beginDeleteById(resourceId, apiVersion, options, callback) { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -3147,7 +3189,13 @@ function _beginCreateOrUpdateById(resourceId, apiVersion, parameters, options, c * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -4265,7 +4313,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -4351,7 +4405,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -4459,7 +4519,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -4545,7 +4611,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -4929,7 +5001,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -5007,7 +5085,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -5107,7 +5191,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -5185,7 +5275,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -5708,7 +5804,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -5794,7 +5896,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -5902,7 +6010,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -5988,7 +6102,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -6177,7 +6297,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -6255,7 +6381,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -6355,7 +6487,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * @@ -6433,7 +6571,13 @@ class Resources { * @param {object} [parameters.identity] The identity of the resource. * * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * + * @param {object} [parameters.identity.userAssignedIdentities] The list of + * user identities associated with the resource. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * * @param {string} [parameters.location] Resource location * diff --git a/lib/services/resourceManagement/lib/resource/resourceManagementClient.d.ts b/lib/services/resourceManagement/lib/resource/resourceManagementClient.d.ts index 402b3e7334..686782a734 100644 --- a/lib/services/resourceManagement/lib/resource/resourceManagementClient.d.ts +++ b/lib/services/resourceManagement/lib/resource/resourceManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class ResourceManagementClient extends AzureServiceClient { +export default class ResourceManagementClient extends AzureServiceClient { /** * Initializes a new instance of the ResourceManagementClient class. * @constructor @@ -33,11 +34,11 @@ declare class ResourceManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -55,6 +56,7 @@ declare class ResourceManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + operations: operations.Operations; deployments: operations.Deployments; providers: operations.Providers; resources: operations.Resources; @@ -63,4 +65,4 @@ declare class ResourceManagementClient extends AzureServiceClient { deploymentOperations: operations.DeploymentOperations; } -export = ResourceManagementClient; +export { ResourceManagementClient, models as ResourceManagementModels }; diff --git a/lib/services/resourceManagement/lib/resource/resourceManagementClient.js b/lib/services/resourceManagement/lib/resource/resourceManagementClient.js index 9e7be32a70..b75e4637d0 100644 --- a/lib/services/resourceManagement/lib/resource/resourceManagementClient.js +++ b/lib/services/resourceManagement/lib/resource/resourceManagementClient.js @@ -34,9 +34,9 @@ class ResourceManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -50,7 +50,7 @@ class ResourceManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2017-05-10'; + this.apiVersion = '2018-05-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -72,6 +72,7 @@ class ResourceManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.operations = new operations.Operations(this); this.deployments = new operations.Deployments(this); this.providers = new operations.Providers(this); this.resources = new operations.Resources(this); @@ -85,3 +86,6 @@ class ResourceManagementClient extends ServiceClient { } module.exports = ResourceManagementClient; +module.exports['default'] = ResourceManagementClient; +module.exports.ResourceManagementClient = ResourceManagementClient; +module.exports.ResourceManagementModels = models; diff --git a/lib/services/resourceManagement/lib/subscription/models/index.d.ts b/lib/services/resourceManagement/lib/subscription/models/index.d.ts index 5468fc3c17..085a18e973 100644 --- a/lib/services/resourceManagement/lib/subscription/models/index.d.ts +++ b/lib/services/resourceManagement/lib/subscription/models/index.d.ts @@ -109,6 +109,59 @@ export interface TenantIdDescription { readonly tenantId?: string; } +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * The object that represents the operation. + * + * @member {string} [provider] Service provider: Microsoft.Resources + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + * @member {string} [description] Description of the operation. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Microsoft.Resources operation + * + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Resources + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + * @member {string} [display.description] Description of the operation. + */ +export interface Operation { + name?: string; + display?: OperationDisplay; +} + + +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor + * Result of the request to list Microsoft.Resources operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ +export interface OperationListResult extends Array { + nextLink?: string; +} /** * @class diff --git a/lib/services/resourceManagement/lib/subscription/models/index.js b/lib/services/resourceManagement/lib/subscription/models/index.js index ff3443438d..7c5915cd2a 100644 --- a/lib/services/resourceManagement/lib/subscription/models/index.js +++ b/lib/services/resourceManagement/lib/subscription/models/index.js @@ -22,6 +22,9 @@ exports.Location = require('./location'); exports.SubscriptionPolicies = require('./subscriptionPolicies'); exports.Subscription = require('./subscription'); exports.TenantIdDescription = require('./tenantIdDescription'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.OperationListResult = require('./operationListResult'); exports.LocationListResult = require('./locationListResult'); exports.SubscriptionListResult = require('./subscriptionListResult'); exports.TenantListResult = require('./tenantListResult'); diff --git a/lib/services/resourceManagement/lib/subscription/models/operation.js b/lib/services/resourceManagement/lib/subscription/models/operation.js new file mode 100644 index 0000000000..72379472eb --- /dev/null +++ b/lib/services/resourceManagement/lib/subscription/models/operation.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Microsoft.Resources operation + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] Service provider: Microsoft.Resources + * @member {string} [display.resource] Resource on which the operation is + * performed: Profile, endpoint, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + * @member {string} [display.description] Description of the operation. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/resourceManagement/lib/subscription/models/operationDisplay.js b/lib/services/resourceManagement/lib/subscription/models/operationDisplay.js new file mode 100644 index 0000000000..43cca64606 --- /dev/null +++ b/lib/services/resourceManagement/lib/subscription/models/operationDisplay.js @@ -0,0 +1,77 @@ +/* + * 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 object that represents the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Service provider: Microsoft.Resources + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + * @member {string} [description] Description of the operation. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/resourceManagement/lib/subscription/models/operationListResult.js b/lib/services/resourceManagement/lib/subscription/models/operationListResult.js new file mode 100644 index 0000000000..ea6f61a74a --- /dev/null +++ b/lib/services/resourceManagement/lib/subscription/models/operationListResult.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'; + +/** + * Result of the request to list Microsoft.Resources operations. It contains a + * list of operations and a URL link to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/resourceManagement/lib/subscription/models/subscription.js b/lib/services/resourceManagement/lib/subscription/models/subscription.js index 9a97a362a2..b0f541a5e7 100644 --- a/lib/services/resourceManagement/lib/subscription/models/subscription.js +++ b/lib/services/resourceManagement/lib/subscription/models/subscription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Subscription information. * diff --git a/lib/services/resourceManagement/lib/subscription/operations/index.d.ts b/lib/services/resourceManagement/lib/subscription/operations/index.d.ts index b70ac95b2d..a382c144c5 100644 --- a/lib/services/resourceManagement/lib/subscription/operations/index.d.ts +++ b/lib/services/resourceManagement/lib/subscription/operations/index.d.ts @@ -12,6 +12,123 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SubscriptionClient. + */ +export interface Operations { + + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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; + + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [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 * Subscriptions diff --git a/lib/services/resourceManagement/lib/subscription/operations/index.js b/lib/services/resourceManagement/lib/subscription/operations/index.js index 7c05ccabc0..2c5f9ff780 100644 --- a/lib/services/resourceManagement/lib/subscription/operations/index.js +++ b/lib/services/resourceManagement/lib/subscription/operations/index.js @@ -14,5 +14,6 @@ 'use strict'; +exports.Operations = require('./operations'); exports.Subscriptions = require('./subscriptions'); exports.Tenants = require('./tenants'); diff --git a/lib/services/resourceManagement/lib/subscription/operations/operations.js b/lib/services/resourceManagement/lib/subscription/operations/operations.js new file mode 100644 index 0000000000..267de97fed --- /dev/null +++ b/lib/services/resourceManagement/lib/subscription/operations/operations.js @@ -0,0 +1,449 @@ +/* + * 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; + +/** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {object} [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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.Resources/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) { + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Operations. */ +class Operations { + /** + * Create a Operations. + * @param {SubscriptionClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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); + } + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous 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 {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {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 = Operations; diff --git a/lib/services/resourceManagement/lib/subscription/subscriptionClient.d.ts b/lib/services/resourceManagement/lib/subscription/subscriptionClient.d.ts index 0e6b67a50b..7ef00b85fb 100644 --- a/lib/services/resourceManagement/lib/subscription/subscriptionClient.d.ts +++ b/lib/services/resourceManagement/lib/subscription/subscriptionClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class SubscriptionClient extends AzureServiceClient { +export default class SubscriptionClient extends AzureServiceClient { /** * Initializes a new instance of the SubscriptionClient class. * @constructor @@ -31,11 +32,11 @@ declare class SubscriptionClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, baseUri?: string, options?: AzureServiceClientOptions); @@ -51,8 +52,9 @@ declare class SubscriptionClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + operations: operations.Operations; subscriptions: operations.Subscriptions; tenants: operations.Tenants; } -export = SubscriptionClient; +export { SubscriptionClient, models as SubscriptionModels }; diff --git a/lib/services/resourceManagement/lib/subscription/subscriptionClient.js b/lib/services/resourceManagement/lib/subscription/subscriptionClient.js index d7e00d2370..c7a83f1c82 100644 --- a/lib/services/resourceManagement/lib/subscription/subscriptionClient.js +++ b/lib/services/resourceManagement/lib/subscription/subscriptionClient.js @@ -33,9 +33,9 @@ class SubscriptionClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -67,6 +67,7 @@ class SubscriptionClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.operations = new operations.Operations(this); this.subscriptions = new operations.Subscriptions(this); this.tenants = new operations.Tenants(this); this.models = models; @@ -76,3 +77,6 @@ class SubscriptionClient extends ServiceClient { } module.exports = SubscriptionClient; +module.exports['default'] = SubscriptionClient; +module.exports.SubscriptionClient = SubscriptionClient; +module.exports.SubscriptionModels = models; diff --git a/lib/services/serviceBusManagement2/LICENSE.txt b/lib/services/serviceBusManagement2/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/serviceBusManagement2/LICENSE.txt +++ b/lib/services/serviceBusManagement2/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/serviceBusManagement2/README.md b/lib/services/serviceBusManagement2/README.md index e9a000a9f6..60458188dd 100644 --- a/lib/services/serviceBusManagement2/README.md +++ b/lib/services/serviceBusManagement2/README.md @@ -1,37 +1,40 @@ -# Microsoft Azure SDK for Node.js - ServicebusManagement - -This project provides a Node.js package that makes it easy to manage Azure Servicebus Resources. Right now it supports: -- **Node.js version: 6.x or higher** - -## How to Install - -```bash -npm install azure-arm-sb -``` - -## How to Use - -### Authentication, client creation and listing namespaces within a subscription as an example - - ```javascript - var msRestAzure = require('ms-rest-azure'); - var ServicebusManagement = require('azure-arm-sb'); - - // Interactive Login - msRestAzure.interactiveLogin(function(err, credentials) { - var client = new ServicebusManagement(credentials, 'your-subscription-id'); - client.namespaces.listBySubscription(function(err, namespaces, request, response) { - if (err) { - console.log(err); - } else { - namespaces.map(function (ns, index, array) { - console.log('found ns :' + ns.name); - })); - } - }); - }); - ``` - -## Related projects - -- [Microsoft Azure SDK for Node.js - All-up](https://github.com/WindowsAzure/azure-sdk-for-node) +--- +uid: azure-arm-sb +summary: *content + +--- +# Microsoft Azure SDK for Node.js - ServiceBusManagementClient +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-sb +``` + +## How to use + +### Authentication, client creation and list operations as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const ServiceBusManagementClient = require("azure-arm-sb"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new ServiceBusManagementClient(creds, subscriptionId); + return client.operations.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/serviceBusManagement2/lib/models/armDisasterRecovery.js b/lib/services/serviceBusManagement2/lib/models/armDisasterRecovery.js index 398509dd71..517a600c9b 100644 --- a/lib/services/serviceBusManagement2/lib/models/armDisasterRecovery.js +++ b/lib/services/serviceBusManagement2/lib/models/armDisasterRecovery.js @@ -24,6 +24,8 @@ class ArmDisasterRecovery extends models['Resource'] { * Alias(Disaster Recovery configuration) - possible values 'Accepted' or * 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', * 'Failed' + * @member {number} [pendingReplicationOperationsCount] Number of entities + * pending to be replicated. * @member {string} [partnerNamespace] ARM Id of the Primary/Secondary * eventhub namespace name, which is part of GEO DR pairning * @member {string} [alternateName] Primary/Secondary eventhub namespace @@ -83,6 +85,14 @@ class ArmDisasterRecovery extends models['Resource'] { allowedValues: [ 'Accepted', 'Succeeded', 'Failed' ] } }, + pendingReplicationOperationsCount: { + required: false, + readOnly: true, + serializedName: 'properties.pendingReplicationOperationsCount', + type: { + name: 'Number' + } + }, partnerNamespace: { required: false, serializedName: 'properties.partnerNamespace', diff --git a/lib/services/serviceBusManagement2/lib/models/captureDescription.js b/lib/services/serviceBusManagement2/lib/models/captureDescription.js index 20b9a4dc60..5c07b4f62f 100644 --- a/lib/services/serviceBusManagement2/lib/models/captureDescription.js +++ b/lib/services/serviceBusManagement2/lib/models/captureDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Properties to configure capture description for eventhub * diff --git a/lib/services/serviceBusManagement2/lib/models/index.d.ts b/lib/services/serviceBusManagement2/lib/models/index.d.ts index 6a7412272f..8e56eb0c8f 100644 --- a/lib/services/serviceBusManagement2/lib/models/index.d.ts +++ b/lib/services/serviceBusManagement2/lib/models/index.d.ts @@ -831,6 +831,8 @@ export interface Eventhub extends Resource { * Alias(Disaster Recovery configuration) - possible values 'Accepted' or * 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', * 'Failed' + * @member {number} [pendingReplicationOperationsCount] Number of entities + * pending to be replicated. * @member {string} [partnerNamespace] ARM Id of the Primary/Secondary eventhub * namespace name, which is part of GEO DR pairning * @member {string} [alternateName] Primary/Secondary eventhub namespace name, @@ -841,11 +843,38 @@ export interface Eventhub extends Resource { */ export interface ArmDisasterRecovery extends Resource { readonly provisioningState?: string; + readonly pendingReplicationOperationsCount?: number; partnerNamespace?: string; alternateName?: string; readonly role?: string; } +/** + * @class + * Initializes a new instance of the MigrationConfigProperties class. + * @constructor + * Single item in List or Get Migration Config operation + * + * @member {string} [provisioningState] Provisioning state of Migration + * Configuration + * @member {number} [pendingReplicationOperationsCount] Number of entities + * pending to be replicated. + * @member {string} targetNamespace Existing premium Namespace ARM Id name + * which has no entities, will be used for migration + * @member {string} postMigrationName Name to access Standard Namespace after + * migration + * @member {string} [migrationState] State in which Standard to Premium + * Migration is, possible values : Unknown, Reverting, Completing, Initiating, + * Syncing, Active + */ +export interface MigrationConfigProperties extends Resource { + readonly provisioningState?: string; + readonly pendingReplicationOperationsCount?: number; + targetNamespace: string; + postMigrationName: string; + readonly migrationState?: string; +} + /** * @class @@ -900,6 +929,19 @@ export interface ArmDisasterRecoveryListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the SBQueueListResult class. diff --git a/lib/services/serviceBusManagement2/lib/models/index.js b/lib/services/serviceBusManagement2/lib/models/index.js index 42d82c7d75..7b97efb7ee 100644 --- a/lib/services/serviceBusManagement2/lib/models/index.js +++ b/lib/services/serviceBusManagement2/lib/models/index.js @@ -48,10 +48,12 @@ exports.Destination = require('./destination'); exports.CaptureDescription = require('./captureDescription'); exports.Eventhub = require('./eventhub'); exports.ArmDisasterRecovery = require('./armDisasterRecovery'); +exports.MigrationConfigProperties = require('./migrationConfigProperties'); exports.OperationListResult = require('./operationListResult'); exports.SBNamespaceListResult = require('./sBNamespaceListResult'); exports.SBAuthorizationRuleListResult = require('./sBAuthorizationRuleListResult'); exports.ArmDisasterRecoveryListResult = require('./armDisasterRecoveryListResult'); +exports.MigrationConfigListResult = require('./migrationConfigListResult'); exports.SBQueueListResult = require('./sBQueueListResult'); exports.SBTopicListResult = require('./sBTopicListResult'); exports.SBSubscriptionListResult = require('./sBSubscriptionListResult'); diff --git a/lib/services/serviceBusManagement2/lib/models/migrationConfigListResult.js b/lib/services/serviceBusManagement2/lib/models/migrationConfigListResult.js new file mode 100644 index 0000000000..b6e1711ccb --- /dev/null +++ b/lib/services/serviceBusManagement2/lib/models/migrationConfigListResult.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'; + +/** + * The result of the List migrationConfigurations operation. + */ +class MigrationConfigListResult extends Array { + /** + * Create a MigrationConfigListResult. + * @member {string} [nextLink] Link to the next set of results. Not empty if + * Value contains incomplete list of migrationConfigurations + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrationConfigListResult + * + * @returns {object} metadata of MigrationConfigListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationConfigListResult', + type: { + name: 'Composite', + className: 'MigrationConfigListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrationConfigPropertiesElementType', + type: { + name: 'Composite', + className: 'MigrationConfigProperties' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationConfigListResult; diff --git a/lib/services/serviceBusManagement2/lib/models/migrationConfigProperties.js b/lib/services/serviceBusManagement2/lib/models/migrationConfigProperties.js new file mode 100644 index 0000000000..156dbaf167 --- /dev/null +++ b/lib/services/serviceBusManagement2/lib/models/migrationConfigProperties.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'); + +/** + * Single item in List or Get Migration Config operation + * + * @extends models['Resource'] + */ +class MigrationConfigProperties extends models['Resource'] { + /** + * Create a MigrationConfigProperties. + * @member {string} [provisioningState] Provisioning state of Migration + * Configuration + * @member {number} [pendingReplicationOperationsCount] Number of entities + * pending to be replicated. + * @member {string} targetNamespace Existing premium Namespace ARM Id name + * which has no entities, will be used for migration + * @member {string} postMigrationName Name to access Standard Namespace after + * migration + * @member {string} [migrationState] State in which Standard to Premium + * Migration is, possible values : Unknown, Reverting, Completing, + * Initiating, Syncing, Active + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrationConfigProperties + * + * @returns {object} metadata of MigrationConfigProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationConfigProperties', + type: { + name: 'Composite', + className: 'MigrationConfigProperties', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + pendingReplicationOperationsCount: { + required: false, + readOnly: true, + serializedName: 'properties.pendingReplicationOperationsCount', + type: { + name: 'Number' + } + }, + targetNamespace: { + required: true, + serializedName: 'properties.targetNamespace', + type: { + name: 'String' + } + }, + postMigrationName: { + required: true, + serializedName: 'properties.postMigrationName', + type: { + name: 'String' + } + }, + migrationState: { + required: false, + readOnly: true, + serializedName: 'properties.migrationState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationConfigProperties; diff --git a/lib/services/serviceBusManagement2/lib/models/operation.js b/lib/services/serviceBusManagement2/lib/models/operation.js index 9f68841ba0..f1569bdb5c 100644 --- a/lib/services/serviceBusManagement2/lib/models/operation.js +++ b/lib/services/serviceBusManagement2/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A ServiceBus REST API operation * diff --git a/lib/services/serviceBusManagement2/lib/operations/index.d.ts b/lib/services/serviceBusManagement2/lib/operations/index.d.ts index b4f4ca57b7..420ce3f3a6 100644 --- a/lib/services/serviceBusManagement2/lib/operations/index.d.ts +++ b/lib/services/serviceBusManagement2/lib/operations/index.d.ts @@ -2204,6 +2204,547 @@ export interface DisasterRecoveryConfigs { listAuthorizationRulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * MigrationConfigs + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceBusManagementClient. + */ +export interface MigrationConfigs { + + + /** + * Gets all migrationConfigurations + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + listWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all migrationConfigurations + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 {MigrationConfigListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrationConfigListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigListResult} for more + * information. + * + * {WebResource} [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(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createAndStartMigrationWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, parameters: models.MigrationConfigProperties, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MigrationConfigProperties} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrationConfigProperties} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigProperties} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createAndStartMigration(resourceGroupName: string, namespaceName: string, parameters: models.MigrationConfigProperties, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createAndStartMigration(resourceGroupName: string, namespaceName: string, parameters: models.MigrationConfigProperties, callback: ServiceCallback): void; + createAndStartMigration(resourceGroupName: string, namespaceName: string, parameters: models.MigrationConfigProperties, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a MigrationConfiguration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a MigrationConfiguration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + deleteMethod(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieves Migration Config + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + getWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves Migration Config + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 {MigrationConfigProperties} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrationConfigProperties} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigProperties} for more + * information. + * + * {WebResource} [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, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation Completes Migration of entities by pointing the connection + * strings to Premium namespace and any enties created after the operation will + * be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + completeMigrationWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation Completes Migration of entities by pointing the connection + * strings to Premium namespace and any enties created after the operation will + * be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + completeMigration(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + completeMigration(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; + completeMigration(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This operation reverts Migration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + revertWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This operation reverts Migration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + revert(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + revert(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; + revert(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateAndStartMigrationWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, parameters: models.MigrationConfigProperties, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MigrationConfigProperties} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrationConfigProperties} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigProperties} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateAndStartMigration(resourceGroupName: string, namespaceName: string, parameters: models.MigrationConfigProperties, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateAndStartMigration(resourceGroupName: string, namespaceName: string, parameters: models.MigrationConfigProperties, callback: ServiceCallback): void; + beginCreateAndStartMigration(resourceGroupName: string, namespaceName: string, parameters: models.MigrationConfigProperties, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all migrationConfigurations + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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>; + + /** + * Gets all migrationConfigurations + * + * @param {string} nextPageLink The NextLink from the 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 {MigrationConfigListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrationConfigListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigListResult} for more + * information. + * + * {WebResource} [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 * Queues @@ -2223,6 +2764,14 @@ export interface Queues { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2232,7 +2781,7 @@ export interface Queues { * * @reject {Error|ServiceError} - The error object. */ - listByNamespaceWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByNamespaceWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the queues within a namespace. @@ -2244,6 +2793,14 @@ export interface Queues { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2269,9 +2826,9 @@ export interface Queues { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByNamespace(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByNamespace(resourceGroupName: string, namespaceName: string, options?: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; listByNamespace(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; - listByNamespace(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByNamespace(resourceGroupName: string, namespaceName: string, options: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3156,6 +3713,14 @@ export interface Topics { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3165,7 +3730,7 @@ export interface Topics { * * @reject {Error|ServiceError} - The error object. */ - listByNamespaceWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByNamespaceWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets all the topics in a namespace. @@ -3177,6 +3742,14 @@ export interface Topics { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3202,9 +3775,9 @@ export interface Topics { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByNamespace(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByNamespace(resourceGroupName: string, namespaceName: string, options?: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; listByNamespace(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; - listByNamespace(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByNamespace(resourceGroupName: string, namespaceName: string, options: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4055,6 +4628,14 @@ export interface Subscriptions { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4064,7 +4645,7 @@ export interface Subscriptions { * * @reject {Error|ServiceError} - The error object. */ - listByTopicWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, topicName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByTopicWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, topicName: string, options?: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * List all the subscriptions under a specified topic. @@ -4078,6 +4659,14 @@ export interface Subscriptions { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4104,9 +4693,9 @@ export interface Subscriptions { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByTopic(resourceGroupName: string, namespaceName: string, topicName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByTopic(resourceGroupName: string, namespaceName: string, topicName: string, options?: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; listByTopic(resourceGroupName: string, namespaceName: string, topicName: string, callback: ServiceCallback): void; - listByTopic(resourceGroupName: string, namespaceName: string, topicName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByTopic(resourceGroupName: string, namespaceName: string, topicName: string, options: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4488,6 +5077,14 @@ export interface Rules { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4497,7 +5094,7 @@ export interface Rules { * * @reject {Error|ServiceError} - The error object. */ - listBySubscriptionsWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, topicName: string, subscriptionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySubscriptionsWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, topicName: string, subscriptionName: string, options?: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * List all the rules within given topic-subscription @@ -4513,6 +5110,14 @@ export interface Rules { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4538,9 +5143,9 @@ export interface Rules { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBySubscriptions(resourceGroupName: string, namespaceName: string, topicName: string, subscriptionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscriptions(resourceGroupName: string, namespaceName: string, topicName: string, subscriptionName: string, options?: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; listBySubscriptions(resourceGroupName: string, namespaceName: string, topicName: string, subscriptionName: string, callback: ServiceCallback): void; - listBySubscriptions(resourceGroupName: string, namespaceName: string, topicName: string, subscriptionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBySubscriptions(resourceGroupName: string, namespaceName: string, topicName: string, subscriptionName: string, options: { skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** diff --git a/lib/services/serviceBusManagement2/lib/operations/index.js b/lib/services/serviceBusManagement2/lib/operations/index.js index 704992b433..dfb03b75a3 100644 --- a/lib/services/serviceBusManagement2/lib/operations/index.js +++ b/lib/services/serviceBusManagement2/lib/operations/index.js @@ -17,6 +17,7 @@ exports.Operations = require('./operations'); exports.Namespaces = require('./namespaces'); exports.DisasterRecoveryConfigs = require('./disasterRecoveryConfigs'); +exports.MigrationConfigs = require('./migrationConfigs'); exports.Queues = require('./queues'); exports.Topics = require('./topics'); exports.Subscriptions = require('./subscriptions'); diff --git a/lib/services/serviceBusManagement2/lib/operations/migrationConfigs.js b/lib/services/serviceBusManagement2/lib/operations/migrationConfigs.js new file mode 100644 index 0000000000..a4b333ccfa --- /dev/null +++ b/lib/services/serviceBusManagement2/lib/operations/migrationConfigs.js @@ -0,0 +1,1995 @@ +/* + * 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; + +/** + * Gets all migrationConfigurations + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 MigrationConfigListResult} for more + * information. + * + * {object} [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(resourceGroupName, namespaceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + 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 (namespaceName !== null && namespaceName !== undefined) { + if (namespaceName.length > 50) + { + throw new Error('"namespaceName" should satisfy the constraint - "MaxLength": 50'); + } + if (namespaceName.length < 6) + { + throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationConfigListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigProperties} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createAndStartMigration(resourceGroupName, namespaceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateAndStartMigration(resourceGroupName, namespaceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationConfigProperties']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Deletes a MigrationConfiguration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 _deleteMethod(resourceGroupName, namespaceName, options, callback) { + /* jshint 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 configName = '$default'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + 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 (namespaceName !== null && namespaceName !== undefined) { + if (namespaceName.length > 50) + { + throw new Error('"namespaceName" should satisfy the constraint - "MaxLength": 50'); + } + if (namespaceName.length < 6) + { + throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{configName}', encodeURIComponent(configName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Retrieves Migration Config + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 MigrationConfigProperties} for more + * information. + * + * {object} [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, namespaceName, options, callback) { + /* jshint 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 configName = '$default'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + 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 (namespaceName !== null && namespaceName !== undefined) { + if (namespaceName.length > 50) + { + throw new Error('"namespaceName" should satisfy the constraint - "MaxLength": 50'); + } + if (namespaceName.length < 6) + { + throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{configName}', encodeURIComponent(configName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationConfigProperties']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * This operation Completes Migration of entities by pointing the connection + * strings to Premium namespace and any enties created after the operation will + * be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 _completeMigration(resourceGroupName, namespaceName, options, callback) { + /* jshint 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 configName = '$default'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + 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 (namespaceName !== null && namespaceName !== undefined) { + if (namespaceName.length > 50) + { + throw new Error('"namespaceName" should satisfy the constraint - "MaxLength": 50'); + } + if (namespaceName.length < 6) + { + throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{configName}', encodeURIComponent(configName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * This operation reverts Migration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 _revert(resourceGroupName, namespaceName, options, callback) { + /* jshint 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 configName = '$default'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + 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 (namespaceName !== null && namespaceName !== undefined) { + if (namespaceName.length > 50) + { + throw new Error('"namespaceName" should satisfy the constraint - "MaxLength": 50'); + } + if (namespaceName.length < 6) + { + throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/revert'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{configName}', encodeURIComponent(configName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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); + }); +} + +/** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigProperties} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateAndStartMigration(resourceGroupName, namespaceName, 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.'); + } + let configName = '$default'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + 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 (namespaceName !== null && namespaceName !== undefined) { + if (namespaceName.length > 50) + { + throw new Error('"namespaceName" should satisfy the constraint - "MaxLength": 50'); + } + if (namespaceName.length < 6) + { + throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); + } + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{configName}', encodeURIComponent(configName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['MigrationConfigProperties']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationConfigProperties']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all migrationConfigurations + * + * @param {string} nextPageLink The NextLink from the previous 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 MigrationConfigListResult} for more + * information. + * + * {object} [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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationConfigListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 MigrationConfigs. */ +class MigrationConfigs { + /** + * Create a MigrationConfigs. + * @param {ServiceBusManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._createAndStartMigration = _createAndStartMigration; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._completeMigration = _completeMigration; + this._revert = _revert; + this._beginCreateAndStartMigration = _beginCreateAndStartMigration; + this._listNext = _listNext; + } + + /** + * Gets all migrationConfigurations + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + listWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, namespaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all migrationConfigurations + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 {MigrationConfigListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigListResult} for more + * information. + * + * {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(resourceGroupName, namespaceName, options, optionalCallback) { + 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(resourceGroupName, namespaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, namespaceName, options, optionalCallback); + } + } + + /** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createAndStartMigrationWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createAndStartMigration(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MigrationConfigProperties} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigProperties} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createAndStartMigration(resourceGroupName, namespaceName, 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._createAndStartMigration(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createAndStartMigration(resourceGroupName, namespaceName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a MigrationConfiguration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, namespaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a MigrationConfiguration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + deleteMethod(resourceGroupName, namespaceName, options, optionalCallback) { + 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, namespaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, namespaceName, options, optionalCallback); + } + } + + /** + * Retrieves Migration Config + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + getWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, namespaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves Migration Config + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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 {MigrationConfigProperties} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigProperties} for more + * information. + * + * {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, namespaceName, options, optionalCallback) { + 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, namespaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, namespaceName, options, optionalCallback); + } + } + + /** + * This operation Completes Migration of entities by pointing the connection + * strings to Premium namespace and any enties created after the operation will + * be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + completeMigrationWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._completeMigration(resourceGroupName, namespaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This operation Completes Migration of entities by pointing the connection + * strings to Premium namespace and any enties created after the operation will + * be under Premium Namespace. CompleteMigration operation will fail when + * entity migration is in-progress. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + completeMigration(resourceGroupName, namespaceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._completeMigration(resourceGroupName, namespaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._completeMigration(resourceGroupName, namespaceName, options, optionalCallback); + } + } + + /** + * This operation reverts Migration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + revertWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._revert(resourceGroupName, namespaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This operation reverts Migration + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace 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. + */ + revert(resourceGroupName, namespaceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._revert(resourceGroupName, namespaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._revert(resourceGroupName, namespaceName, options, optionalCallback); + } + } + + /** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateAndStartMigrationWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateAndStartMigration(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates Migration configuration and starts migration of enties from Standard + * to Premium namespace + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {string} namespaceName The namespace name + * + * @param {object} parameters Parameters required to create Migration + * Configuration + * + * @param {string} parameters.targetNamespace Existing premium Namespace ARM Id + * name which has no entities, will be used for migration + * + * @param {string} parameters.postMigrationName Name to access Standard + * Namespace after migration + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MigrationConfigProperties} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigProperties} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateAndStartMigration(resourceGroupName, namespaceName, 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._beginCreateAndStartMigration(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateAndStartMigration(resourceGroupName, namespaceName, parameters, options, optionalCallback); + } + } + + /** + * Gets all migrationConfigurations + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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; + }); + }); + } + + /** + * Gets all migrationConfigurations + * + * @param {string} nextPageLink The NextLink from the previous 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 {MigrationConfigListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationConfigListResult} for more + * information. + * + * {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 = MigrationConfigs; diff --git a/lib/services/serviceBusManagement2/lib/operations/queues.js b/lib/services/serviceBusManagement2/lib/operations/queues.js index 1578d3f68b..f84f61d7fa 100644 --- a/lib/services/serviceBusManagement2/lib/operations/queues.js +++ b/lib/services/serviceBusManagement2/lib/operations/queues.js @@ -25,6 +25,14 @@ const moment = require('moment'); * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -51,6 +59,8 @@ function _listByNamespace(resourceGroupName, namespaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -85,6 +95,32 @@ function _listByNamespace(resourceGroupName, namespaceName, options, callback) { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (skip !== null && skip !== undefined) { + if (skip > 1000) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMaximum": 1000'); + } + if (skip < 0) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (top !== null && top !== undefined) { + if (top > 1000) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMaximum": 1000'); + } + if (top < 1) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -100,6 +136,12 @@ function _listByNamespace(resourceGroupName, namespaceName, options, callback) { requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2250,6 +2292,14 @@ class Queues { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2283,6 +2333,14 @@ class Queues { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * diff --git a/lib/services/serviceBusManagement2/lib/operations/rules.js b/lib/services/serviceBusManagement2/lib/operations/rules.js index 56fb43b4f2..f85e6af08b 100644 --- a/lib/services/serviceBusManagement2/lib/operations/rules.js +++ b/lib/services/serviceBusManagement2/lib/operations/rules.js @@ -28,6 +28,14 @@ const WebResource = msRest.WebResource; * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -54,6 +62,8 @@ function _listBySubscriptions(resourceGroupName, namespaceName, topicName, subsc if (!callback) { throw new Error('callback cannot be null.'); } + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -110,6 +120,32 @@ function _listBySubscriptions(resourceGroupName, namespaceName, topicName, subsc if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (skip !== null && skip !== undefined) { + if (skip > 1000) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMaximum": 1000'); + } + if (skip < 0) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (top !== null && top !== undefined) { + if (top > 1000) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMaximum": 1000'); + } + if (top < 1) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -127,6 +163,12 @@ function _listBySubscriptions(resourceGroupName, namespaceName, topicName, subsc requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1057,6 +1099,14 @@ class Rules { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1094,6 +1144,14 @@ class Rules { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * diff --git a/lib/services/serviceBusManagement2/lib/operations/subscriptions.js b/lib/services/serviceBusManagement2/lib/operations/subscriptions.js index 8e3e5bdf79..fa22c021c7 100644 --- a/lib/services/serviceBusManagement2/lib/operations/subscriptions.js +++ b/lib/services/serviceBusManagement2/lib/operations/subscriptions.js @@ -27,6 +27,14 @@ const moment = require('moment'); * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -54,6 +62,8 @@ function _listByTopic(resourceGroupName, namespaceName, topicName, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -97,6 +107,32 @@ function _listByTopic(resourceGroupName, namespaceName, topicName, options, call if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (skip !== null && skip !== undefined) { + if (skip > 1000) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMaximum": 1000'); + } + if (skip < 0) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (top !== null && top !== undefined) { + if (top > 1000) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMaximum": 1000'); + } + if (top < 1) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -113,6 +149,12 @@ function _listByTopic(resourceGroupName, namespaceName, topicName, options, call requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -981,6 +1023,14 @@ class Subscriptions { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1016,6 +1066,14 @@ class Subscriptions { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * diff --git a/lib/services/serviceBusManagement2/lib/operations/topics.js b/lib/services/serviceBusManagement2/lib/operations/topics.js index aa1d3762b9..8bd778266e 100644 --- a/lib/services/serviceBusManagement2/lib/operations/topics.js +++ b/lib/services/serviceBusManagement2/lib/operations/topics.js @@ -25,6 +25,14 @@ const moment = require('moment'); * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -51,6 +59,8 @@ function _listByNamespace(resourceGroupName, namespaceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -85,6 +95,32 @@ function _listByNamespace(resourceGroupName, namespaceName, options, callback) { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (skip !== null && skip !== undefined) { + if (skip > 1000) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMaximum": 1000'); + } + if (skip < 0) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (top !== null && top !== undefined) { + if (top > 1000) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMaximum": 1000'); + } + if (top < 1) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -100,6 +136,12 @@ function _listByNamespace(resourceGroupName, namespaceName, options, callback) { requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2232,6 +2274,14 @@ class Topics { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2265,6 +2315,14 @@ class Topics { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] Skip is only used if a previous operation + * returned a partial result. If a previous response contains a nextLink + * element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + * + * @param {number} [options.top] May be used to limit the number of results to + * the most recent N usageDetails. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * diff --git a/lib/services/serviceBusManagement2/lib/serviceBusManagementClient.d.ts b/lib/services/serviceBusManagement2/lib/serviceBusManagementClient.d.ts index 2cec427818..d8cef73430 100644 --- a/lib/services/serviceBusManagement2/lib/serviceBusManagementClient.d.ts +++ b/lib/services/serviceBusManagement2/lib/serviceBusManagementClient.d.ts @@ -34,11 +34,11 @@ export default class ServiceBusManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -59,6 +59,7 @@ export default class ServiceBusManagementClient extends AzureServiceClient { operations: operations.Operations; namespaces: operations.Namespaces; disasterRecoveryConfigs: operations.DisasterRecoveryConfigs; + migrationConfigs: operations.MigrationConfigs; queues: operations.Queues; topics: operations.Topics; subscriptions: operations.Subscriptions; diff --git a/lib/services/serviceBusManagement2/lib/serviceBusManagementClient.js b/lib/services/serviceBusManagement2/lib/serviceBusManagementClient.js index e4d0ec81f4..8e9f309e51 100644 --- a/lib/services/serviceBusManagement2/lib/serviceBusManagementClient.js +++ b/lib/services/serviceBusManagement2/lib/serviceBusManagementClient.js @@ -34,9 +34,9 @@ class ServiceBusManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -75,6 +75,7 @@ class ServiceBusManagementClient extends ServiceClient { this.operations = new operations.Operations(this); this.namespaces = new operations.Namespaces(this); this.disasterRecoveryConfigs = new operations.DisasterRecoveryConfigs(this); + this.migrationConfigs = new operations.MigrationConfigs(this); this.queues = new operations.Queues(this); this.topics = new operations.Topics(this); this.subscriptions = new operations.Subscriptions(this); diff --git a/lib/services/serviceBusManagement2/package.json b/lib/services/serviceBusManagement2/package.json index 4c741e4072..c75766ca84 100644 --- a/lib/services/serviceBusManagement2/package.json +++ b/lib/services/serviceBusManagement2/package.json @@ -7,16 +7,19 @@ "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", "main": "./lib/serviceBusManagementClient.js", "types": "./lib/serviceBusManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } diff --git a/lib/services/trafficManagerManagement2/LICENSE.txt b/lib/services/trafficManagerManagement2/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/trafficManagerManagement2/LICENSE.txt +++ b/lib/services/trafficManagerManagement2/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/trafficManagerManagement2/README.md b/lib/services/trafficManagerManagement2/README.md index 7c6a9d4cf2..48d90322bd 100644 --- a/lib/services/trafficManagerManagement2/README.md +++ b/lib/services/trafficManagerManagement2/README.md @@ -1,44 +1,44 @@ ---- -uid: azure-arm-trafficmanager -summary: *content - ---- -# Microsoft Azure SDK for Node.js - TrafficManagerManagementClient -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-trafficmanager -``` - -## How to use - -### Authentication, client creation and get endpoints as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const TrafficManagerManagementClient = require("azure-arm-trafficmanager"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new TrafficManagerManagementClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const profileName = "testprofileName"; - const endpointType = "testendpointType"; - const endpointName = "testendpointName"; - return client.endpoints.get(resourceGroupName, profileName, endpointType, endpointName).then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-arm-trafficmanager +summary: *content + +--- +# Microsoft Azure SDK for Node.js - TrafficManagerManagementClient +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-trafficmanager +``` + +## How to use + +### Authentication, client creation and get endpoints as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const TrafficManagerManagementClient = require("azure-arm-trafficmanager"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new TrafficManagerManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const profileName = "testprofileName"; + const endpointType = "testendpointType"; + const endpointName = "testendpointName"; + return client.endpoints.get(resourceGroupName, profileName, endpointType, endpointName).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/trafficManagerManagement2/lib/models/endpoint.js b/lib/services/trafficManagerManagement2/lib/models/endpoint.js index d2f4703a9b..1263b5c67e 100644 --- a/lib/services/trafficManagerManagement2/lib/models/endpoint.js +++ b/lib/services/trafficManagerManagement2/lib/models/endpoint.js @@ -22,21 +22,21 @@ class Endpoint extends models['ProxyResource'] { * Create a Endpoint. * @member {string} [targetResourceId] The Azure Resource URI of the of the * endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. - * @member {string} [target] The fully-qualified DNS name of the endpoint. - * Traffic Manager returns this value in DNS responses to direct traffic to - * this endpoint. + * @member {string} [target] The fully-qualified DNS name or IP address of + * the endpoint. Traffic Manager returns this value in DNS responses to + * direct traffic to this endpoint. * @member {string} [endpointStatus] The status of the endpoint. If the * endpoint is Enabled, it is probed for endpoint health and is included in * the traffic routing method. Possible values include: 'Enabled', 'Disabled' * @member {number} [weight] The weight of this endpoint when using the * 'Weighted' traffic routing method. Possible values are from 1 to 1000. * @member {number} [priority] The priority of this endpoint when using the - * ‘Priority’ traffic routing method. Possible values are from 1 to 1000, + * 'Priority' traffic routing method. Possible values are from 1 to 1000, * lower values represent higher priority. This is an optional parameter. If * specified, it must be specified on all endpoints, and no two endpoints can * share the same priority value. * @member {string} [endpointLocation] Specifies the location of the external - * or nested endpoints when using the ‘Performance’ traffic routing method. + * or nested endpoints when using the 'Performance' traffic routing method. * @member {string} [endpointMonitorStatus] The monitoring status of the * endpoint. Possible values include: 'CheckingEndpoint', 'Online', * 'Degraded', 'Disabled', 'Inactive', 'Stopped' @@ -45,9 +45,14 @@ class Endpoint extends models['ProxyResource'] { * be considered available. Only applicable to endpoint of type * 'NestedEndpoints'. * @member {array} [geoMapping] The list of countries/regions mapped to this - * endpoint when using the ‘Geographic’ traffic routing method. Please + * endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of * accepted values. + * @member {array} [subnets] The list of subnets, IP addresses, and/or + * address ranges mapped to this endpoint when using the 'Subnet' traffic + * routing method. An empty list will match all ranges not covered by other + * endpoints. + * @member {array} [customHeaders] List of custom headers. */ constructor() { super(); @@ -69,7 +74,6 @@ class Endpoint extends models['ProxyResource'] { modelProperties: { id: { required: false, - readOnly: true, serializedName: 'id', type: { name: 'String' @@ -77,7 +81,6 @@ class Endpoint extends models['ProxyResource'] { }, name: { required: false, - readOnly: true, serializedName: 'name', type: { name: 'String' @@ -85,7 +88,6 @@ class Endpoint extends models['ProxyResource'] { }, type: { required: false, - readOnly: true, serializedName: 'type', type: { name: 'String' @@ -160,6 +162,36 @@ class Endpoint extends models['ProxyResource'] { } } } + }, + subnets: { + required: false, + serializedName: 'properties.subnets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EndpointPropertiesSubnetsItemElementType', + type: { + name: 'Composite', + className: 'EndpointPropertiesSubnetsItem' + } + } + } + }, + customHeaders: { + required: false, + serializedName: 'properties.customHeaders', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EndpointPropertiesCustomHeadersItemElementType', + type: { + name: 'Composite', + className: 'EndpointPropertiesCustomHeadersItem' + } + } + } } } } diff --git a/lib/services/trafficManagerManagement2/lib/models/endpointPropertiesCustomHeadersItem.js b/lib/services/trafficManagerManagement2/lib/models/endpointPropertiesCustomHeadersItem.js new file mode 100644 index 0000000000..95fdeeb9f5 --- /dev/null +++ b/lib/services/trafficManagerManagement2/lib/models/endpointPropertiesCustomHeadersItem.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Custom header name and value. + * + */ +class EndpointPropertiesCustomHeadersItem { + /** + * Create a EndpointPropertiesCustomHeadersItem. + * @member {string} [name] Header name. + * @member {string} [value] Header value. + */ + constructor() { + } + + /** + * Defines the metadata of EndpointPropertiesCustomHeadersItem + * + * @returns {object} metadata of EndpointPropertiesCustomHeadersItem + * + */ + mapper() { + return { + required: false, + serializedName: 'EndpointProperties_customHeadersItem', + type: { + name: 'Composite', + className: 'EndpointPropertiesCustomHeadersItem', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EndpointPropertiesCustomHeadersItem; diff --git a/lib/services/trafficManagerManagement2/lib/models/endpointPropertiesSubnetsItem.js b/lib/services/trafficManagerManagement2/lib/models/endpointPropertiesSubnetsItem.js new file mode 100644 index 0000000000..5238cc5570 --- /dev/null +++ b/lib/services/trafficManagerManagement2/lib/models/endpointPropertiesSubnetsItem.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'; + +/** + * Subnet first address, scope, and/or last address. + * + */ +class EndpointPropertiesSubnetsItem { + /** + * Create a EndpointPropertiesSubnetsItem. + * @member {string} [first] First address in the subnet. + * @member {string} [last] Last address in the subnet. + * @member {number} [scope] Block size (number of leading bits in the subnet + * mask). + */ + constructor() { + } + + /** + * Defines the metadata of EndpointPropertiesSubnetsItem + * + * @returns {object} metadata of EndpointPropertiesSubnetsItem + * + */ + mapper() { + return { + required: false, + serializedName: 'EndpointProperties_subnetsItem', + type: { + name: 'Composite', + className: 'EndpointPropertiesSubnetsItem', + modelProperties: { + first: { + required: false, + serializedName: 'first', + type: { + name: 'String' + } + }, + last: { + required: false, + serializedName: 'last', + type: { + name: 'String' + } + }, + scope: { + required: false, + serializedName: 'scope', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = EndpointPropertiesSubnetsItem; diff --git a/lib/services/trafficManagerManagement2/lib/models/heatMapModel.js b/lib/services/trafficManagerManagement2/lib/models/heatMapModel.js index dc6a5c8dd7..3c271a8586 100644 --- a/lib/services/trafficManagerManagement2/lib/models/heatMapModel.js +++ b/lib/services/trafficManagerManagement2/lib/models/heatMapModel.js @@ -49,7 +49,6 @@ class HeatMapModel extends models['ProxyResource'] { modelProperties: { id: { required: false, - readOnly: true, serializedName: 'id', type: { name: 'String' @@ -57,7 +56,6 @@ class HeatMapModel extends models['ProxyResource'] { }, name: { required: false, - readOnly: true, serializedName: 'name', type: { name: 'String' @@ -65,7 +63,6 @@ class HeatMapModel extends models['ProxyResource'] { }, type: { required: false, - readOnly: true, serializedName: 'type', type: { name: 'String' diff --git a/lib/services/trafficManagerManagement2/lib/models/index.d.ts b/lib/services/trafficManagerManagement2/lib/models/index.d.ts index 3b7e661131..9e327f8c65 100644 --- a/lib/services/trafficManagerManagement2/lib/models/index.d.ts +++ b/lib/services/trafficManagerManagement2/lib/models/index.d.ts @@ -28,6 +28,94 @@ export interface DeleteOperationResult { readonly operationResult?: boolean; } +/** + * @class + * Initializes a new instance of the EndpointPropertiesSubnetsItem class. + * @constructor + * Subnet first address, scope, and/or last address. + * + * @member {string} [first] First address in the subnet. + * @member {string} [last] Last address in the subnet. + * @member {number} [scope] Block size (number of leading bits in the subnet + * mask). + */ +export interface EndpointPropertiesSubnetsItem { + first?: string; + last?: string; + scope?: number; +} + +/** + * @class + * Initializes a new instance of the EndpointPropertiesCustomHeadersItem class. + * @constructor + * Custom header name and value. + * + * @member {string} [name] Header name. + * @member {string} [value] Header value. + */ +export interface EndpointPropertiesCustomHeadersItem { + name?: string; + value?: string; +} + +/** + * @class + * Initializes a new instance of the HeatMapEndpoint class. + * @constructor + * Class which is a sparse representation of a Traffic Manager endpoint. + * + * @member {string} [resourceId] The ARM Resource ID of this Traffic Manager + * endpoint. + * @member {number} [endpointId] A number uniquely identifying this endpoint in + * query experiences. + */ +export interface HeatMapEndpoint { + resourceId?: string; + endpointId?: number; +} + +/** + * @class + * Initializes a new instance of the QueryExperience class. + * @constructor + * Class representing a Traffic Manager HeatMap query experience properties. + * + * @member {number} endpointId The id of the endpoint from the 'endpoints' + * array which these queries were routed to. + * @member {number} queryCount The number of queries originating from this + * location. + * @member {number} [latency] The latency experienced by queries originating + * from this location. + */ +export interface QueryExperience { + endpointId: number; + queryCount: number; + latency?: number; +} + +/** + * @class + * Initializes a new instance of the TrafficFlow class. + * @constructor + * Class representing a Traffic Manager HeatMap traffic flow properties. + * + * @member {string} [sourceIp] The IP address that this query experience + * originated from. + * @member {number} [latitude] The approximate latitude that these queries + * originated from. + * @member {number} [longitude] The approximate longitude that these queries + * originated from. + * @member {array} [queryExperiences] The query experiences produced in this + * HeatMap calculation. + */ +export interface TrafficFlow { + sourceIp?: string; + latitude?: number; + longitude?: number; + queryExperiences?: QueryExperience[]; +} + /** * @class * Initializes a new instance of the Resource class. @@ -41,9 +129,9 @@ export interface DeleteOperationResult { * Microsoft.Network/trafficmanagerProfiles. */ export interface Resource extends BaseResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; + id?: string; + name?: string; + type?: string; } /** @@ -57,6 +145,39 @@ export interface Resource extends BaseResource { export interface ProxyResource extends Resource { } +/** + * @class + * Initializes a new instance of the HeatMapModel class. + * @constructor + * Class representing a Traffic Manager HeatMap. + * + * @member {date} [startTime] The beginning of the time window for this + * HeatMap, inclusive. + * @member {date} [endTime] The ending of the time window for this HeatMap, + * exclusive. + * @member {array} [endpoints] The endpoints used in this HeatMap calculation. + * @member {array} [trafficFlows] The traffic flows produced in this HeatMap + * calculation. + */ +export interface HeatMapModel extends ProxyResource { + startTime?: Date; + endTime?: Date; + endpoints?: HeatMapEndpoint[]; + trafficFlows?: TrafficFlow[]; +} + +/** + * @class + * Initializes a new instance of the UserMetricsModel class. + * @constructor + * Class representing Traffic Manager User Metrics. + * + * @member {string} [key] The key returned by the User Metrics operation. + */ +export interface UserMetricsModel extends ProxyResource { + key?: string; +} + /** * @class * Initializes a new instance of the Endpoint class. @@ -65,21 +186,21 @@ export interface ProxyResource extends Resource { * * @member {string} [targetResourceId] The Azure Resource URI of the of the * endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. - * @member {string} [target] The fully-qualified DNS name of the endpoint. - * Traffic Manager returns this value in DNS responses to direct traffic to - * this endpoint. + * @member {string} [target] The fully-qualified DNS name or IP address of the + * endpoint. Traffic Manager returns this value in DNS responses to direct + * traffic to this endpoint. * @member {string} [endpointStatus] The status of the endpoint. If the * endpoint is Enabled, it is probed for endpoint health and is included in the * traffic routing method. Possible values include: 'Enabled', 'Disabled' * @member {number} [weight] The weight of this endpoint when using the * 'Weighted' traffic routing method. Possible values are from 1 to 1000. * @member {number} [priority] The priority of this endpoint when using the - * ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower + * 'Priority' traffic routing method. Possible values are from 1 to 1000, lower * values represent higher priority. This is an optional parameter. If * specified, it must be specified on all endpoints, and no two endpoints can * share the same priority value. * @member {string} [endpointLocation] Specifies the location of the external - * or nested endpoints when using the ‘Performance’ traffic routing method. + * or nested endpoints when using the 'Performance' traffic routing method. * @member {string} [endpointMonitorStatus] The monitoring status of the * endpoint. Possible values include: 'CheckingEndpoint', 'Online', 'Degraded', * 'Disabled', 'Inactive', 'Stopped' @@ -87,8 +208,12 @@ export interface ProxyResource extends Resource { * must be available in the child profile in order for the parent profile to be * considered available. Only applicable to endpoint of type 'NestedEndpoints'. * @member {array} [geoMapping] The list of countries/regions mapped to this - * endpoint when using the ‘Geographic’ traffic routing method. Please consult + * endpoint when using the 'Geographic' traffic routing method. Please consult * Traffic Manager Geographic documentation for a full list of accepted values. + * @member {array} [subnets] The list of subnets, IP addresses, and/or address + * ranges mapped to this endpoint when using the 'Subnet' traffic routing + * method. An empty list will match all ranges not covered by other endpoints. + * @member {array} [customHeaders] List of custom headers. */ export interface Endpoint extends ProxyResource { targetResourceId?: string; @@ -100,6 +225,8 @@ export interface Endpoint extends ProxyResource { endpointMonitorStatus?: string; minChildEndpoints?: number; geoMapping?: string[]; + subnets?: EndpointPropertiesSubnetsItem[]; + customHeaders?: EndpointPropertiesCustomHeadersItem[]; } /** @@ -139,6 +266,34 @@ export interface DnsConfig { ttl?: number; } +/** + * @class + * Initializes a new instance of the MonitorConfigCustomHeadersItem class. + * @constructor + * Custom header name and value. + * + * @member {string} [name] Header name. + * @member {string} [value] Header value. + */ +export interface MonitorConfigCustomHeadersItem { + name?: string; + value?: string; +} + +/** + * @class + * Initializes a new instance of the MonitorConfigExpectedStatusCodeRangesItem class. + * @constructor + * Min and max value of a status code range. + * + * @member {number} [min] Min status code. + * @member {number} [max] Max status code. + */ +export interface MonitorConfigExpectedStatusCodeRangesItem { + min?: number; + max?: number; +} + /** * @class * Initializes a new instance of the MonitorConfig class. @@ -162,6 +317,9 @@ export interface DnsConfig { * @member {number} [toleratedNumberOfFailures] The number of consecutive * failed health check that Traffic Manager tolerates before declaring an * endpoint in this profile Degraded after the next failed health check. + * @member {array} [customHeaders] List of custom headers. + * @member {array} [expectedStatusCodeRanges] List of expected status code + * ranges. */ export interface MonitorConfig { profileMonitorStatus?: string; @@ -171,6 +329,8 @@ export interface MonitorConfig { intervalInSeconds?: number; timeoutInSeconds?: number; toleratedNumberOfFailures?: number; + customHeaders?: MonitorConfigCustomHeadersItem[]; + expectedStatusCodeRanges?: MonitorConfigExpectedStatusCodeRangesItem[]; } /** @@ -197,7 +357,7 @@ export interface TrackedResource extends Resource { * Possible values include: 'Enabled', 'Disabled' * @member {string} [trafficRoutingMethod] The traffic routing method of the * Traffic Manager profile. Possible values include: 'Performance', 'Priority', - * 'Weighted', 'Geographic' + * 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * @member {object} [dnsConfig] The DNS settings of the Traffic Manager * profile. * @member {string} [dnsConfig.relativeName] The relative DNS name provided by @@ -232,8 +392,17 @@ export interface TrackedResource extends Resource { * consecutive failed health check that Traffic Manager tolerates before * declaring an endpoint in this profile Degraded after the next failed health * check. + * @member {array} [monitorConfig.customHeaders] List of custom headers. + * @member {array} [monitorConfig.expectedStatusCodeRanges] List of expected + * status code ranges. * @member {array} [endpoints] The list of endpoints in the Traffic Manager * profile. + * @member {string} [trafficViewEnrollmentStatus] Indicates whether Traffic + * View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, + * indicates 'Disabled'. Enabling this feature will increase the cost of the + * Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * @member {number} [maxReturn] Maximum number of endpoints to be returned for + * MultiValue routing type. */ export interface Profile extends TrackedResource { profileStatus?: string; @@ -241,6 +410,8 @@ export interface Profile extends TrackedResource { dnsConfig?: DnsConfig; monitorConfig?: MonitorConfig; endpoints?: Endpoint[]; + trafficViewEnrollmentStatus?: string; + maxReturn?: number; } /** @@ -302,96 +473,6 @@ export interface TrafficManagerGeographicHierarchy extends ProxyResource { geographicHierarchy?: Region; } -/** - * @class - * Initializes a new instance of the HeatMapEndpoint class. - * @constructor - * Class which is a sparse representation of a Traffic Manager endpoint. - * - * @member {string} [resourceId] The ARM Resource ID of this Traffic Manager - * endpoint. - * @member {number} [endpointId] A number uniquely identifying this endpoint in - * query experiences. - */ -export interface HeatMapEndpoint { - resourceId?: string; - endpointId?: number; -} - -/** - * @class - * Initializes a new instance of the QueryExperience class. - * @constructor - * Class representing a Traffic Manager HeatMap query experience properties. - * - * @member {number} endpointId The id of the endpoint from the 'endpoints' - * array which these queries were routed to. - * @member {number} queryCount The number of queries originating from this - * location. - * @member {number} [latency] The latency experienced by queries originating - * from this location. - */ -export interface QueryExperience { - endpointId: number; - queryCount: number; - latency?: number; -} - -/** - * @class - * Initializes a new instance of the TrafficFlow class. - * @constructor - * Class representing a Traffic Manager HeatMap traffic flow properties. - * - * @member {string} [sourceIp] The IP address that this query experience - * originated from. - * @member {number} [latitude] The approximate latitude that these queries - * originated from. - * @member {number} [longitude] The approximate longitude that these queries - * originated from. - * @member {array} [queryExperiences] The query experiences produced in this - * HeatMap calculation. - */ -export interface TrafficFlow { - sourceIp?: string; - latitude?: number; - longitude?: number; - queryExperiences?: QueryExperience[]; -} - -/** - * @class - * Initializes a new instance of the HeatMapModel class. - * @constructor - * Class representing a Traffic Manager HeatMap. - * - * @member {date} [startTime] The beginning of the time window for this - * HeatMap, inclusive. - * @member {date} [endTime] The ending of the time window for this HeatMap, - * exclusive. - * @member {array} [endpoints] The endpoints used in this HeatMap calculation. - * @member {array} [trafficFlows] The traffic flows produced in this HeatMap - * calculation. - */ -export interface HeatMapModel extends ProxyResource { - startTime?: Date; - endTime?: Date; - endpoints?: HeatMapEndpoint[]; - trafficFlows?: TrafficFlow[]; -} - -/** - * @class - * Initializes a new instance of the TrafficManagerUserMetricsKeyModel class. - * @constructor - * Class representing a Traffic Manager Real User Metrics key response. - * - * @member {string} [key] The key returned by the Real User Metrics operation. - */ -export interface TrafficManagerUserMetricsKeyModel extends ProxyResource { - key?: string; -} - /** * @class diff --git a/lib/services/trafficManagerManagement2/lib/models/index.js b/lib/services/trafficManagerManagement2/lib/models/index.js index 2c22d444bd..99c349ee2a 100644 --- a/lib/services/trafficManagerManagement2/lib/models/index.js +++ b/lib/services/trafficManagerManagement2/lib/models/index.js @@ -19,20 +19,24 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.DeleteOperationResult = require('./deleteOperationResult'); +exports.EndpointPropertiesSubnetsItem = require('./endpointPropertiesSubnetsItem'); +exports.EndpointPropertiesCustomHeadersItem = require('./endpointPropertiesCustomHeadersItem'); +exports.HeatMapEndpoint = require('./heatMapEndpoint'); +exports.QueryExperience = require('./queryExperience'); +exports.TrafficFlow = require('./trafficFlow'); exports.Resource = require('./resource'); exports.ProxyResource = require('./proxyResource'); +exports.HeatMapModel = require('./heatMapModel'); +exports.UserMetricsModel = require('./userMetricsModel'); exports.Endpoint = require('./endpoint'); exports.CheckTrafficManagerRelativeDnsNameAvailabilityParameters = require('./checkTrafficManagerRelativeDnsNameAvailabilityParameters'); exports.DnsConfig = require('./dnsConfig'); +exports.MonitorConfigCustomHeadersItem = require('./monitorConfigCustomHeadersItem'); +exports.MonitorConfigExpectedStatusCodeRangesItem = require('./monitorConfigExpectedStatusCodeRangesItem'); exports.MonitorConfig = require('./monitorConfig'); exports.TrackedResource = require('./trackedResource'); exports.Profile = require('./profile'); exports.TrafficManagerNameAvailability = require('./trafficManagerNameAvailability'); exports.Region = require('./region'); exports.TrafficManagerGeographicHierarchy = require('./trafficManagerGeographicHierarchy'); -exports.HeatMapEndpoint = require('./heatMapEndpoint'); -exports.QueryExperience = require('./queryExperience'); -exports.TrafficFlow = require('./trafficFlow'); -exports.HeatMapModel = require('./heatMapModel'); -exports.TrafficManagerUserMetricsKeyModel = require('./trafficManagerUserMetricsKeyModel'); exports.ProfileListResult = require('./profileListResult'); diff --git a/lib/services/trafficManagerManagement2/lib/models/monitorConfig.js b/lib/services/trafficManagerManagement2/lib/models/monitorConfig.js index aca63f57f6..108544e40c 100644 --- a/lib/services/trafficManagerManagement2/lib/models/monitorConfig.js +++ b/lib/services/trafficManagerManagement2/lib/models/monitorConfig.js @@ -34,6 +34,9 @@ class MonitorConfig { * @member {number} [toleratedNumberOfFailures] The number of consecutive * failed health check that Traffic Manager tolerates before declaring an * endpoint in this profile Degraded after the next failed health check. + * @member {array} [customHeaders] List of custom headers. + * @member {array} [expectedStatusCodeRanges] List of expected status code + * ranges. */ constructor() { } @@ -100,6 +103,36 @@ class MonitorConfig { type: { name: 'Number' } + }, + customHeaders: { + required: false, + serializedName: 'customHeaders', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MonitorConfigCustomHeadersItemElementType', + type: { + name: 'Composite', + className: 'MonitorConfigCustomHeadersItem' + } + } + } + }, + expectedStatusCodeRanges: { + required: false, + serializedName: 'expectedStatusCodeRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MonitorConfigExpectedStatusCodeRangesItemElementType', + type: { + name: 'Composite', + className: 'MonitorConfigExpectedStatusCodeRangesItem' + } + } + } } } } diff --git a/lib/services/trafficManagerManagement2/lib/models/monitorConfigCustomHeadersItem.js b/lib/services/trafficManagerManagement2/lib/models/monitorConfigCustomHeadersItem.js new file mode 100644 index 0000000000..370133e328 --- /dev/null +++ b/lib/services/trafficManagerManagement2/lib/models/monitorConfigCustomHeadersItem.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Custom header name and value. + * + */ +class MonitorConfigCustomHeadersItem { + /** + * Create a MonitorConfigCustomHeadersItem. + * @member {string} [name] Header name. + * @member {string} [value] Header value. + */ + constructor() { + } + + /** + * Defines the metadata of MonitorConfigCustomHeadersItem + * + * @returns {object} metadata of MonitorConfigCustomHeadersItem + * + */ + mapper() { + return { + required: false, + serializedName: 'MonitorConfig_customHeadersItem', + type: { + name: 'Composite', + className: 'MonitorConfigCustomHeadersItem', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MonitorConfigCustomHeadersItem; diff --git a/lib/services/trafficManagerManagement2/lib/models/monitorConfigExpectedStatusCodeRangesItem.js b/lib/services/trafficManagerManagement2/lib/models/monitorConfigExpectedStatusCodeRangesItem.js new file mode 100644 index 0000000000..481d530d96 --- /dev/null +++ b/lib/services/trafficManagerManagement2/lib/models/monitorConfigExpectedStatusCodeRangesItem.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Min and max value of a status code range. + * + */ +class MonitorConfigExpectedStatusCodeRangesItem { + /** + * Create a MonitorConfigExpectedStatusCodeRangesItem. + * @member {number} [min] Min status code. + * @member {number} [max] Max status code. + */ + constructor() { + } + + /** + * Defines the metadata of MonitorConfigExpectedStatusCodeRangesItem + * + * @returns {object} metadata of MonitorConfigExpectedStatusCodeRangesItem + * + */ + mapper() { + return { + required: false, + serializedName: 'MonitorConfig_expectedStatusCodeRangesItem', + type: { + name: 'Composite', + className: 'MonitorConfigExpectedStatusCodeRangesItem', + modelProperties: { + min: { + required: false, + serializedName: 'min', + type: { + name: 'Number' + } + }, + max: { + required: false, + serializedName: 'max', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MonitorConfigExpectedStatusCodeRangesItem; diff --git a/lib/services/trafficManagerManagement2/lib/models/profile.js b/lib/services/trafficManagerManagement2/lib/models/profile.js index a7b607660a..6c63901829 100644 --- a/lib/services/trafficManagerManagement2/lib/models/profile.js +++ b/lib/services/trafficManagerManagement2/lib/models/profile.js @@ -24,7 +24,7 @@ class Profile extends models['TrackedResource'] { * profile. Possible values include: 'Enabled', 'Disabled' * @member {string} [trafficRoutingMethod] The traffic routing method of the * Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * @member {object} [dnsConfig] The DNS settings of the Traffic Manager * profile. * @member {string} [dnsConfig.relativeName] The relative DNS name provided @@ -59,8 +59,17 @@ class Profile extends models['TrackedResource'] { * consecutive failed health check that Traffic Manager tolerates before * declaring an endpoint in this profile Degraded after the next failed * health check. + * @member {array} [monitorConfig.customHeaders] List of custom headers. + * @member {array} [monitorConfig.expectedStatusCodeRanges] List of expected + * status code ranges. * @member {array} [endpoints] The list of endpoints in the Traffic Manager * profile. + * @member {string} [trafficViewEnrollmentStatus] Indicates whether Traffic + * View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, + * indicates 'Disabled'. Enabling this feature will increase the cost of the + * Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * @member {number} [maxReturn] Maximum number of endpoints to be returned + * for MultiValue routing type. */ constructor() { super(); @@ -82,7 +91,6 @@ class Profile extends models['TrackedResource'] { modelProperties: { id: { required: false, - readOnly: true, serializedName: 'id', type: { name: 'String' @@ -90,7 +98,6 @@ class Profile extends models['TrackedResource'] { }, name: { required: false, - readOnly: true, serializedName: 'name', type: { name: 'String' @@ -98,7 +105,6 @@ class Profile extends models['TrackedResource'] { }, type: { required: false, - readOnly: true, serializedName: 'type', type: { name: 'String' @@ -169,6 +175,20 @@ class Profile extends models['TrackedResource'] { } } } + }, + trafficViewEnrollmentStatus: { + required: false, + serializedName: 'properties.trafficViewEnrollmentStatus', + type: { + name: 'String' + } + }, + maxReturn: { + required: false, + serializedName: 'properties.maxReturn', + type: { + name: 'Number' + } } } } diff --git a/lib/services/trafficManagerManagement2/lib/models/proxyResource.js b/lib/services/trafficManagerManagement2/lib/models/proxyResource.js index 43e93ec60e..d37fefb0c8 100644 --- a/lib/services/trafficManagerManagement2/lib/models/proxyResource.js +++ b/lib/services/trafficManagerManagement2/lib/models/proxyResource.js @@ -42,7 +42,6 @@ class ProxyResource extends models['Resource'] { modelProperties: { id: { required: false, - readOnly: true, serializedName: 'id', type: { name: 'String' @@ -50,7 +49,6 @@ class ProxyResource extends models['Resource'] { }, name: { required: false, - readOnly: true, serializedName: 'name', type: { name: 'String' @@ -58,7 +56,6 @@ class ProxyResource extends models['Resource'] { }, type: { required: false, - readOnly: true, serializedName: 'type', type: { name: 'String' diff --git a/lib/services/trafficManagerManagement2/lib/models/region.js b/lib/services/trafficManagerManagement2/lib/models/region.js index bd45962d60..5ecca9dcd8 100644 --- a/lib/services/trafficManagerManagement2/lib/models/region.js +++ b/lib/services/trafficManagerManagement2/lib/models/region.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing a region in the Geographic hierarchy used with the * Geographic traffic routing method. diff --git a/lib/services/trafficManagerManagement2/lib/models/resource.js b/lib/services/trafficManagerManagement2/lib/models/resource.js index 93c8a9e769..9ba87ce426 100644 --- a/lib/services/trafficManagerManagement2/lib/models/resource.js +++ b/lib/services/trafficManagerManagement2/lib/models/resource.js @@ -46,7 +46,6 @@ class Resource extends models['BaseResource'] { modelProperties: { id: { required: false, - readOnly: true, serializedName: 'id', type: { name: 'String' @@ -54,7 +53,6 @@ class Resource extends models['BaseResource'] { }, name: { required: false, - readOnly: true, serializedName: 'name', type: { name: 'String' @@ -62,7 +60,6 @@ class Resource extends models['BaseResource'] { }, type: { required: false, - readOnly: true, serializedName: 'type', type: { name: 'String' diff --git a/lib/services/trafficManagerManagement2/lib/models/trackedResource.js b/lib/services/trafficManagerManagement2/lib/models/trackedResource.js index be5d3b94c0..44e5930e74 100644 --- a/lib/services/trafficManagerManagement2/lib/models/trackedResource.js +++ b/lib/services/trafficManagerManagement2/lib/models/trackedResource.js @@ -43,7 +43,6 @@ class TrackedResource extends models['Resource'] { modelProperties: { id: { required: false, - readOnly: true, serializedName: 'id', type: { name: 'String' @@ -51,7 +50,6 @@ class TrackedResource extends models['Resource'] { }, name: { required: false, - readOnly: true, serializedName: 'name', type: { name: 'String' @@ -59,7 +57,6 @@ class TrackedResource extends models['Resource'] { }, type: { required: false, - readOnly: true, serializedName: 'type', type: { name: 'String' diff --git a/lib/services/trafficManagerManagement2/lib/models/trafficFlow.js b/lib/services/trafficManagerManagement2/lib/models/trafficFlow.js index 684813d7a8..1937ae3d7d 100644 --- a/lib/services/trafficManagerManagement2/lib/models/trafficFlow.js +++ b/lib/services/trafficManagerManagement2/lib/models/trafficFlow.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing a Traffic Manager HeatMap traffic flow properties. * diff --git a/lib/services/trafficManagerManagement2/lib/models/trafficManagerGeographicHierarchy.js b/lib/services/trafficManagerManagement2/lib/models/trafficManagerGeographicHierarchy.js index e85eb0c645..5bd06efcf0 100644 --- a/lib/services/trafficManagerManagement2/lib/models/trafficManagerGeographicHierarchy.js +++ b/lib/services/trafficManagerManagement2/lib/models/trafficManagerGeographicHierarchy.js @@ -48,7 +48,6 @@ class TrafficManagerGeographicHierarchy extends models['ProxyResource'] { modelProperties: { id: { required: false, - readOnly: true, serializedName: 'id', type: { name: 'String' @@ -56,7 +55,6 @@ class TrafficManagerGeographicHierarchy extends models['ProxyResource'] { }, name: { required: false, - readOnly: true, serializedName: 'name', type: { name: 'String' @@ -64,7 +62,6 @@ class TrafficManagerGeographicHierarchy extends models['ProxyResource'] { }, type: { required: false, - readOnly: true, serializedName: 'type', type: { name: 'String' diff --git a/lib/services/trafficManagerManagement2/lib/models/userMetricsModel.js b/lib/services/trafficManagerManagement2/lib/models/userMetricsModel.js new file mode 100644 index 0000000000..842f0d0bd0 --- /dev/null +++ b/lib/services/trafficManagerManagement2/lib/models/userMetricsModel.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing Traffic Manager User Metrics. + * + * @extends models['ProxyResource'] + */ +class UserMetricsModel extends models['ProxyResource'] { + /** + * Create a UserMetricsModel. + * @member {string} [key] The key returned by the User Metrics operation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of UserMetricsModel + * + * @returns {object} metadata of UserMetricsModel + * + */ + mapper() { + return { + required: false, + serializedName: 'UserMetricsModel', + type: { + name: 'Composite', + className: 'UserMetricsModel', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + }, + key: { + required: false, + serializedName: 'properties.key', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UserMetricsModel; diff --git a/lib/services/trafficManagerManagement2/lib/operations/endpoints.js b/lib/services/trafficManagerManagement2/lib/operations/endpoints.js index 2f20a7840f..e83c4c9a85 100644 --- a/lib/services/trafficManagerManagement2/lib/operations/endpoints.js +++ b/lib/services/trafficManagerManagement2/lib/operations/endpoints.js @@ -34,9 +34,9 @@ const WebResource = msRest.WebResource; * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -46,13 +46,13 @@ const WebResource = msRest.WebResource; * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -65,10 +65,17 @@ const WebResource = msRest.WebResource; * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -97,7 +104,6 @@ function _update(resourceGroupName, profileName, endpointType, endpointName, par if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -115,6 +121,9 @@ function _update(resourceGroupName, profileName, endpointType, endpointName, par if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -134,7 +143,7 @@ function _update(resourceGroupName, profileName, endpointType, endpointName, par requestUrl = requestUrl.replace('{endpointName}', encodeURIComponent(endpointName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -270,7 +279,6 @@ function _get(resourceGroupName, profileName, endpointType, endpointName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -285,6 +293,9 @@ function _get(resourceGroupName, profileName, endpointType, endpointName, option if (endpointName === null || endpointName === undefined || typeof endpointName.valueOf() !== 'string') { throw new Error('endpointName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -304,7 +315,7 @@ function _get(resourceGroupName, profileName, endpointType, endpointName, option requestUrl = requestUrl.replace('{endpointName}', encodeURIComponent(endpointName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -406,9 +417,9 @@ function _get(resourceGroupName, profileName, endpointType, endpointName, option * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -418,13 +429,13 @@ function _get(resourceGroupName, profileName, endpointType, endpointName, option * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -437,10 +448,17 @@ function _get(resourceGroupName, profileName, endpointType, endpointName, option * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -469,7 +487,6 @@ function _createOrUpdate(resourceGroupName, profileName, endpointType, endpointN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -487,6 +504,9 @@ function _createOrUpdate(resourceGroupName, profileName, endpointType, endpointN if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -506,7 +526,7 @@ function _createOrUpdate(resourceGroupName, profileName, endpointType, endpointN requestUrl = requestUrl.replace('{endpointName}', encodeURIComponent(endpointName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -661,7 +681,6 @@ function _deleteMethod(resourceGroupName, profileName, endpointType, endpointNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -676,6 +695,9 @@ function _deleteMethod(resourceGroupName, profileName, endpointType, endpointNam if (endpointName === null || endpointName === undefined || typeof endpointName.valueOf() !== 'string') { throw new Error('endpointName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -695,7 +717,7 @@ function _deleteMethod(resourceGroupName, profileName, endpointType, endpointNam requestUrl = requestUrl.replace('{endpointName}', encodeURIComponent(endpointName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -811,9 +833,9 @@ class Endpoints { * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -823,13 +845,13 @@ class Endpoints { * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -842,10 +864,17 @@ class Endpoints { * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -891,9 +920,9 @@ class Endpoints { * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -903,13 +932,13 @@ class Endpoints { * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -922,10 +951,17 @@ class Endpoints { * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1089,9 +1125,9 @@ class Endpoints { * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -1101,13 +1137,13 @@ class Endpoints { * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -1120,10 +1156,17 @@ class Endpoints { * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1169,9 +1212,9 @@ class Endpoints { * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -1181,13 +1224,13 @@ class Endpoints { * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -1200,10 +1243,17 @@ class Endpoints { * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/trafficManagerManagement2/lib/operations/geographicHierarchies.js b/lib/services/trafficManagerManagement2/lib/operations/geographicHierarchies.js index 5823c1fd98..ea21e663f3 100644 --- a/lib/services/trafficManagerManagement2/lib/operations/geographicHierarchies.js +++ b/lib/services/trafficManagerManagement2/lib/operations/geographicHierarchies.js @@ -47,9 +47,11 @@ function _getDefault(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // 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.'); } @@ -61,7 +63,7 @@ function _getDefault(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Network/trafficManagerGeographicHierarchies/default'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/trafficManagerManagement2/lib/operations/heatMap.js b/lib/services/trafficManagerManagement2/lib/operations/heatMap.js index 11e4c63a4f..d06e562650 100644 --- a/lib/services/trafficManagerManagement2/lib/operations/heatMap.js +++ b/lib/services/trafficManagerManagement2/lib/operations/heatMap.js @@ -59,7 +59,6 @@ function _get(resourceGroupName, profileName, options, callback) { let topLeft = (options && options.topLeft !== undefined) ? options.topLeft : undefined; let botRight = (options && options.botRight !== undefined) ? options.botRight : undefined; let heatMapType = 'default'; - let apiVersion = '2017-09-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -105,6 +104,9 @@ function _get(resourceGroupName, profileName, options, callback) { throw new Error('"botRight" should satisfy the constraint - "MinItems": 2'); } } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -126,7 +128,7 @@ function _get(resourceGroupName, profileName, options, callback) { if (botRight !== null && botRight !== undefined) { queryParameters.push('botRight=' + encodeURIComponent(botRight.join(','))); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/trafficManagerManagement2/lib/operations/index.d.ts b/lib/services/trafficManagerManagement2/lib/operations/index.d.ts index 92a18a51ab..b22a1e7c84 100644 --- a/lib/services/trafficManagerManagement2/lib/operations/index.d.ts +++ b/lib/services/trafficManagerManagement2/lib/operations/index.d.ts @@ -41,9 +41,9 @@ export interface Endpoints { * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -53,13 +53,13 @@ export interface Endpoints { * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -72,10 +72,17 @@ export interface Endpoints { * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -109,9 +116,9 @@ export interface Endpoints { * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -121,13 +128,13 @@ export interface Endpoints { * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -140,10 +147,17 @@ export interface Endpoints { * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -265,9 +279,9 @@ export interface Endpoints { * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -277,13 +291,13 @@ export interface Endpoints { * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -296,10 +310,17 @@ export interface Endpoints { * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -333,9 +354,9 @@ export interface Endpoints { * @param {string} [parameters.targetResourceId] The Azure Resource URI of the * of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. * - * @param {string} [parameters.target] The fully-qualified DNS name of the - * endpoint. Traffic Manager returns this value in DNS responses to direct - * traffic to this endpoint. + * @param {string} [parameters.target] The fully-qualified DNS name or IP + * address of the endpoint. Traffic Manager returns this value in DNS responses + * to direct traffic to this endpoint. * * @param {string} [parameters.endpointStatus] The status of the endpoint. If * the endpoint is Enabled, it is probed for endpoint health and is included in @@ -345,13 +366,13 @@ export interface Endpoints { * the 'Weighted' traffic routing method. Possible values are from 1 to 1000. * * @param {number} [parameters.priority] The priority of this endpoint when - * using the ‘Priority’ traffic routing method. Possible values are from 1 to + * using the 'Priority' traffic routing method. Possible values are from 1 to * 1000, lower values represent higher priority. This is an optional parameter. * If specified, it must be specified on all endpoints, and no two endpoints * can share the same priority value. * * @param {string} [parameters.endpointLocation] Specifies the location of the - * external or nested endpoints when using the ‘Performance’ traffic routing + * external or nested endpoints when using the 'Performance' traffic routing * method. * * @param {string} [parameters.endpointMonitorStatus] The monitoring status of @@ -364,10 +385,17 @@ export interface Endpoints { * type 'NestedEndpoints'. * * @param {array} [parameters.geoMapping] The list of countries/regions mapped - * to this endpoint when using the ‘Geographic’ traffic routing method. Please + * to this endpoint when using the 'Geographic' traffic routing method. Please * consult Traffic Manager Geographic documentation for a full list of accepted * values. * + * @param {array} [parameters.subnets] The list of subnets, IP addresses, + * and/or address ranges mapped to this endpoint when using the 'Subnet' + * traffic routing method. An empty list will match all ranges not covered by + * other endpoints. + * + * @param {array} [parameters.customHeaders] List of custom headers. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -733,7 +761,7 @@ export interface Profiles { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -778,9 +806,23 @@ export interface Profiles { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -815,7 +857,7 @@ export interface Profiles { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -860,9 +902,23 @@ export interface Profiles { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -979,7 +1035,7 @@ export interface Profiles { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -1024,9 +1080,23 @@ export interface Profiles { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -1061,7 +1131,7 @@ export interface Profiles { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -1106,9 +1176,23 @@ export interface Profiles { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -1310,11 +1394,11 @@ export interface TrafficManagerUserMetricsKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Get the subscription-level key used for Real User Metrics collection. @@ -1331,7 +1415,7 @@ export interface TrafficManagerUserMetricsKeys { * * {Promise} A promise is returned. * - * @resolve {TrafficManagerUserMetricsKeyModel} - The deserialized result object. + * @resolve {UserMetricsModel} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1339,17 +1423,16 @@ export interface TrafficManagerUserMetricsKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TrafficManagerUserMetricsKeyModel} [result] - The deserialized result object if an error did not occur. - * See {@link TrafficManagerUserMetricsKeyModel} for more - * information. + * {UserMetricsModel} [result] - The deserialized result object if an error did not occur. + * See {@link UserMetricsModel} for more information. * * {WebResource} [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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(callback: ServiceCallback): void; - get(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(callback: ServiceCallback): void; + get(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1363,11 +1446,11 @@ export interface TrafficManagerUserMetricsKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Create or update a subscription-level key used for Real User Metrics @@ -1385,7 +1468,7 @@ export interface TrafficManagerUserMetricsKeys { * * {Promise} A promise is returned. * - * @resolve {TrafficManagerUserMetricsKeyModel} - The deserialized result object. + * @resolve {UserMetricsModel} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1393,17 +1476,16 @@ export interface TrafficManagerUserMetricsKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TrafficManagerUserMetricsKeyModel} [result] - The deserialized result object if an error did not occur. - * See {@link TrafficManagerUserMetricsKeyModel} for more - * information. + * {UserMetricsModel} [result] - The deserialized result object if an error did not occur. + * See {@link UserMetricsModel} for more information. * * {WebResource} [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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(callback: ServiceCallback): void; - createOrUpdate(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(callback: ServiceCallback): void; + createOrUpdate(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** diff --git a/lib/services/trafficManagerManagement2/lib/operations/profiles.js b/lib/services/trafficManagerManagement2/lib/operations/profiles.js index d80018bc33..5a93ab2254 100644 --- a/lib/services/trafficManagerManagement2/lib/operations/profiles.js +++ b/lib/services/trafficManagerManagement2/lib/operations/profiles.js @@ -53,12 +53,14 @@ function _checkTrafficManagerRelativeDnsNameAvailability(parameters, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -70,7 +72,7 @@ function _checkTrafficManagerRelativeDnsNameAvailability(parameters, options, ca let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Network/checkTrafficManagerNameAvailability'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -200,12 +202,14 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -222,7 +226,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -335,9 +339,11 @@ function _listBySubscription(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -353,7 +359,7 @@ function _listBySubscription(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -471,7 +477,6 @@ function _get(resourceGroupName, profileName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -480,6 +485,9 @@ function _get(resourceGroupName, profileName, options, callback) { if (profileName === null || profileName === undefined || typeof profileName.valueOf() !== 'string') { throw new Error('profileName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -497,7 +505,7 @@ function _get(resourceGroupName, profileName, options, callback) { requestUrl = requestUrl.replace('{profileName}', encodeURIComponent(profileName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -595,7 +603,7 @@ function _get(resourceGroupName, profileName, options, callback) { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -640,9 +648,23 @@ function _get(resourceGroupName, profileName, options, callback) { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -676,7 +698,6 @@ function _createOrUpdate(resourceGroupName, profileName, parameters, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -688,6 +709,9 @@ function _createOrUpdate(resourceGroupName, profileName, parameters, options, ca if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -705,7 +729,7 @@ function _createOrUpdate(resourceGroupName, profileName, parameters, options, ca requestUrl = requestUrl.replace('{profileName}', encodeURIComponent(profileName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -855,7 +879,6 @@ function _deleteMethod(resourceGroupName, profileName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -864,6 +887,9 @@ function _deleteMethod(resourceGroupName, profileName, options, callback) { if (profileName === null || profileName === undefined || typeof profileName.valueOf() !== 'string') { throw new Error('profileName cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -881,7 +907,7 @@ function _deleteMethod(resourceGroupName, profileName, options, callback) { requestUrl = requestUrl.replace('{profileName}', encodeURIComponent(profileName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -979,7 +1005,7 @@ function _deleteMethod(resourceGroupName, profileName, options, callback) { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -1024,9 +1050,23 @@ function _deleteMethod(resourceGroupName, profileName, options, callback) { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -1060,7 +1100,6 @@ function _update(resourceGroupName, profileName, parameters, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-05-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1072,6 +1111,9 @@ function _update(resourceGroupName, profileName, parameters, options, callback) if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1089,7 +1131,7 @@ function _update(resourceGroupName, profileName, parameters, options, callback) requestUrl = requestUrl.replace('{profileName}', encodeURIComponent(profileName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1561,7 +1603,7 @@ class Profiles { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -1606,9 +1648,23 @@ class Profiles { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -1655,7 +1711,7 @@ class Profiles { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -1700,9 +1756,23 @@ class Profiles { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -1861,7 +1931,7 @@ class Profiles { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -1906,9 +1976,23 @@ class Profiles { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource @@ -1955,7 +2039,7 @@ class Profiles { * * @param {string} [parameters.trafficRoutingMethod] The traffic routing method * of the Traffic Manager profile. Possible values include: 'Performance', - * 'Priority', 'Weighted', 'Geographic' + * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet' * * @param {object} [parameters.dnsConfig] The DNS settings of the Traffic * Manager profile. @@ -2000,9 +2084,23 @@ class Profiles { * before declaring an endpoint in this profile Degraded after the next failed * health check. * + * @param {array} [parameters.monitorConfig.expectedStatusCodeRanges] List of + * expected status code ranges. + * + * @param {array} [parameters.monitorConfig.customHeaders] List of custom + * headers. + * * @param {array} [parameters.endpoints] The list of endpoints in the Traffic * Manager profile. * + * @param {string} [parameters.trafficViewEnrollmentStatus] Indicates whether + * Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. + * Null, indicates 'Disabled'. Enabling this feature will increase the cost of + * the Traffic Manage profile. Possible values include: 'Enabled', 'Disabled' + * + * @param {number} [parameters.maxReturn] Maximum number of endpoints to be + * returned for MultiValue routing type. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.location] The Azure Region where the resource diff --git a/lib/services/trafficManagerManagement2/lib/operations/trafficManagerUserMetricsKeys.js b/lib/services/trafficManagerManagement2/lib/operations/trafficManagerUserMetricsKeys.js index 7ef1a2e3d0..dd3c9ad4da 100644 --- a/lib/services/trafficManagerManagement2/lib/operations/trafficManagerUserMetricsKeys.js +++ b/lib/services/trafficManagerManagement2/lib/operations/trafficManagerUserMetricsKeys.js @@ -29,8 +29,7 @@ const WebResource = msRest.WebResource; * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TrafficManagerUserMetricsKeyModel} for more - * information. + * See {@link UserMetricsModel} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -46,9 +45,11 @@ function _get(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-09-01-preview'; // 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -61,10 +62,10 @@ function _get(options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -131,7 +132,7 @@ function _get(options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TrafficManagerUserMetricsKeyModel']().mapper(); + let resultMapper = new client.models['UserMetricsModel']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -162,8 +163,7 @@ function _get(options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TrafficManagerUserMetricsKeyModel} for more - * information. + * See {@link UserMetricsModel} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -179,9 +179,11 @@ function _createOrUpdate(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-09-01-preview'; // 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -194,10 +196,10 @@ function _createOrUpdate(options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -264,7 +266,7 @@ function _createOrUpdate(options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TrafficManagerUserMetricsKeyModel']().mapper(); + let resultMapper = new client.models['UserMetricsModel']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -310,9 +312,11 @@ function _deleteMethod(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-09-01-preview'; // 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -325,10 +329,10 @@ function _deleteMethod(options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -433,7 +437,7 @@ class TrafficManagerUserMetricsKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -466,7 +470,7 @@ class TrafficManagerUserMetricsKeys { * * {Promise} A promise is returned * - * @resolve {TrafficManagerUserMetricsKeyModel} - The deserialized result object. + * @resolve {UserMetricsModel} - The deserialized result object. * * @reject {Error} - The error object. * @@ -475,8 +479,7 @@ class TrafficManagerUserMetricsKeys { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TrafficManagerUserMetricsKeyModel} for more - * information. + * See {@link UserMetricsModel} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -513,7 +516,7 @@ class TrafficManagerUserMetricsKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -547,7 +550,7 @@ class TrafficManagerUserMetricsKeys { * * {Promise} A promise is returned * - * @resolve {TrafficManagerUserMetricsKeyModel} - The deserialized result object. + * @resolve {UserMetricsModel} - The deserialized result object. * * @reject {Error} - The error object. * @@ -556,8 +559,7 @@ class TrafficManagerUserMetricsKeys { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TrafficManagerUserMetricsKeyModel} for more - * information. + * See {@link UserMetricsModel} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/trafficManagerManagement2/lib/trafficManagerManagementClient.d.ts b/lib/services/trafficManagerManagement2/lib/trafficManagerManagementClient.d.ts index 6c351eed2b..aedac307bf 100644 --- a/lib/services/trafficManagerManagement2/lib/trafficManagerManagementClient.d.ts +++ b/lib/services/trafficManagerManagement2/lib/trafficManagerManagementClient.d.ts @@ -34,11 +34,11 @@ export default class TrafficManagerManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -47,6 +47,8 @@ export default class TrafficManagerManagementClient extends AzureServiceClient { subscriptionId: string; + apiVersion: string; + acceptLanguage: string; longRunningOperationRetryTimeout: number; diff --git a/lib/services/trafficManagerManagement2/lib/trafficManagerManagementClient.js b/lib/services/trafficManagerManagement2/lib/trafficManagerManagementClient.js index 7c46c07ee2..e62df1b35b 100644 --- a/lib/services/trafficManagerManagement2/lib/trafficManagerManagementClient.js +++ b/lib/services/trafficManagerManagement2/lib/trafficManagerManagementClient.js @@ -34,9 +34,9 @@ class TrafficManagerManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -50,6 +50,7 @@ class TrafficManagerManagementClient extends ServiceClient { super(credentials, options); + this.apiVersion = '2018-04-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; diff --git a/lib/services/trafficManagerManagement2/package.json b/lib/services/trafficManagerManagement2/package.json index 581efa4e48..5d1964f22a 100644 --- a/lib/services/trafficManagerManagement2/package.json +++ b/lib/services/trafficManagerManagement2/package.json @@ -4,7 +4,7 @@ "description": "TrafficManagerManagementClient Library with typescript type definitions for node", "version": "3.0.0", "dependencies": { - "ms-rest": "^2.3.2", + "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, "keywords": [ @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/trafficManagerManagementClient.js", "types": "./lib/trafficManagerManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } diff --git a/lib/services/websiteManagement2/LICENSE.txt b/lib/services/websiteManagement2/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/websiteManagement2/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/websiteManagement2/README.md b/lib/services/websiteManagement2/README.md new file mode 100644 index 0000000000..74dfd85526 --- /dev/null +++ b/lib/services/websiteManagement2/README.md @@ -0,0 +1,40 @@ +--- +uid: azure-arm-website +summary: *content + +--- +# Microsoft Azure SDK for Node.js - WebSiteManagementClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features + + +## How to Install + +```bash +npm install azure-arm-website +``` + +## How to use + +### Authentication, client creation and list appServiceCertificateOrders as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const WebSiteManagementClient = require("azure-arm-website"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new WebSiteManagementClient(creds, subscriptionId); + return client.appServiceCertificateOrders.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +## Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js b/lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js new file mode 100644 index 0000000000..af74f2332a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing Abnormal Time Period identified in diagnosis + * + */ +class AbnormalTimePeriod { + /** + * Create a AbnormalTimePeriod. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of AbnormalTimePeriod + * + * @returns {object} metadata of AbnormalTimePeriod + * + */ + mapper() { + return { + required: false, + serializedName: 'AbnormalTimePeriod', + type: { + name: 'Composite', + className: 'AbnormalTimePeriod', + modelProperties: { + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + events: { + required: false, + serializedName: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DetectorAbnormalTimePeriodElementType', + type: { + name: 'Composite', + className: 'DetectorAbnormalTimePeriod' + } + } + } + }, + solutions: { + required: false, + serializedName: 'solutions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SolutionElementType', + type: { + name: 'Composite', + className: 'Solution' + } + } + } + } + } + } + }; + } +} + +module.exports = AbnormalTimePeriod; diff --git a/lib/services/websiteManagement2/lib/models/address.js b/lib/services/websiteManagement2/lib/models/address.js new file mode 100644 index 0000000000..31450935e3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/address.js @@ -0,0 +1,92 @@ +/* + * 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'; + +/** + * Address information for domain registration. + * + */ +class Address { + /** + * Create a Address. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of Address + * + * @returns {object} metadata of Address + * + */ + mapper() { + return { + required: false, + serializedName: 'Address', + type: { + name: 'Composite', + className: 'Address', + modelProperties: { + address1: { + required: true, + serializedName: 'address1', + type: { + name: 'String' + } + }, + address2: { + required: false, + serializedName: 'address2', + type: { + name: 'String' + } + }, + city: { + required: true, + serializedName: 'city', + type: { + name: 'String' + } + }, + country: { + required: true, + serializedName: 'country', + type: { + name: 'String' + } + }, + postalCode: { + required: true, + serializedName: 'postalCode', + type: { + name: 'String' + } + }, + state: { + required: true, + serializedName: 'state', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Address; diff --git a/lib/services/websiteManagement2/lib/models/addressResponse.js b/lib/services/websiteManagement2/lib/models/addressResponse.js new file mode 100644 index 0000000000..28dcbfbd00 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/addressResponse.js @@ -0,0 +1,93 @@ +/* + * 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'; + +/** + * Describes main public IP address and any extra virtual IPs. + * + */ +class AddressResponse { + /** + * Create a AddressResponse. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of AddressResponse + * + * @returns {object} metadata of AddressResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'AddressResponse', + type: { + name: 'Composite', + className: 'AddressResponse', + modelProperties: { + serviceIpAddress: { + required: false, + serializedName: 'serviceIpAddress', + type: { + name: 'String' + } + }, + internalIpAddress: { + required: false, + serializedName: 'internalIpAddress', + type: { + name: 'String' + } + }, + outboundIpAddresses: { + required: false, + serializedName: 'outboundIpAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + vipMappings: { + required: false, + serializedName: 'vipMappings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualIPMappingElementType', + type: { + name: 'Composite', + className: 'VirtualIPMapping' + } + } + } + } + } + } + }; + } +} + +module.exports = AddressResponse; diff --git a/lib/services/websiteManagement2/lib/models/analysisData.js b/lib/services/websiteManagement2/lib/models/analysisData.js new file mode 100644 index 0000000000..f23e81d09b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/analysisData.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'; + +/** + * Class Representing Detector Evidence used for analysis + * + */ +class AnalysisData { + /** + * Create a AnalysisData. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of AnalysisData + * + * @returns {object} metadata of AnalysisData + * + */ + mapper() { + return { + required: false, + serializedName: 'AnalysisData', + type: { + name: 'Composite', + className: 'AnalysisData', + modelProperties: { + source: { + required: false, + serializedName: 'source', + type: { + name: 'String' + } + }, + detectorDefinition: { + required: false, + serializedName: 'detectorDefinition', + type: { + name: 'Composite', + className: 'DetectorDefinition' + } + }, + metrics: { + required: false, + serializedName: 'metrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiagnosticMetricSetElementType', + type: { + name: 'Composite', + className: 'DiagnosticMetricSet' + } + } + } + }, + data: { + required: false, + serializedName: 'data', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + } + } + }, + detectorMetaData: { + required: false, + serializedName: 'detectorMetaData', + type: { + name: 'Composite', + className: 'ResponseMetaData' + } + } + } + } + }; + } +} + +module.exports = AnalysisData; diff --git a/lib/services/websiteManagement2/lib/models/analysisDefinition.js b/lib/services/websiteManagement2/lib/models/analysisDefinition.js new file mode 100644 index 0000000000..66545279fd --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/analysisDefinition.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'); + +/** + * Definition of Analysis + * + * @extends models['ProxyOnlyResource'] + */ +class AnalysisDefinition extends models['ProxyOnlyResource'] { + /** + * Create a AnalysisDefinition. + * @member {string} [description] Description of the Analysis + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AnalysisDefinition + * + * @returns {object} metadata of AnalysisDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'AnalysisDefinition', + type: { + name: 'Composite', + className: 'AnalysisDefinition', + 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' + } + } + } + } + }; + } +} + +module.exports = AnalysisDefinition; diff --git a/lib/services/websiteManagement2/lib/models/apiDefinitionInfo.js b/lib/services/websiteManagement2/lib/models/apiDefinitionInfo.js new file mode 100644 index 0000000000..c7bc43edc4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/apiDefinitionInfo.js @@ -0,0 +1,52 @@ +/* + * 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 about the formal API definition for the app. + * + */ +class ApiDefinitionInfo { + /** + * Create a ApiDefinitionInfo. + * @member {string} [url] The URL of the API definition. + */ + constructor() { + } + + /** + * Defines the metadata of ApiDefinitionInfo + * + * @returns {object} metadata of ApiDefinitionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ApiDefinitionInfo', + type: { + name: 'Composite', + className: 'ApiDefinitionInfo', + modelProperties: { + url: { + required: false, + serializedName: 'url', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApiDefinitionInfo; diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificate.js b/lib/services/websiteManagement2/lib/models/appServiceCertificate.js new file mode 100644 index 0000000000..299b1210d7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificate.js @@ -0,0 +1,75 @@ +/* + * 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'; + +/** + * Key Vault container for a certificate that is purchased through Azure. + * + */ +class AppServiceCertificate { + /** + * Create a AppServiceCertificate. + * @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' + */ + constructor() { + } + + /** + * Defines the metadata of AppServiceCertificate + * + * @returns {object} metadata of AppServiceCertificate + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceCertificate', + type: { + name: 'Composite', + className: 'AppServiceCertificate', + modelProperties: { + keyVaultId: { + required: false, + serializedName: 'keyVaultId', + type: { + name: 'String' + } + }, + keyVaultSecretName: { + required: false, + serializedName: 'keyVaultSecretName', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] + } + } + } + } + }; + } +} + +module.exports = AppServiceCertificate; diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificateCollection.js b/lib/services/websiteManagement2/lib/models/appServiceCertificateCollection.js new file mode 100644 index 0000000000..5ca5f99e91 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificateCollection.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 certitificateorder certificates. + */ +class AppServiceCertificateCollection extends Array { + /** + * Create a AppServiceCertificateCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceCertificateCollection + * + * @returns {object} metadata of AppServiceCertificateCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceCertificateCollection', + type: { + name: 'Composite', + className: 'AppServiceCertificateCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AppServiceCertificateResourceElementType', + type: { + name: 'Composite', + className: 'AppServiceCertificateResource' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppServiceCertificateCollection; diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificateOrder.js b/lib/services/websiteManagement2/lib/models/appServiceCertificateOrder.js new file mode 100644 index 0000000000..4adc193a58 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificateOrder.js @@ -0,0 +1,337 @@ +/* + * 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 purchase order. + * + * @extends models['Resource'] + */ +class AppServiceCertificateOrder extends models['Resource'] { + /** + * Create a AppServiceCertificateOrder. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceCertificateOrder + * + * @returns {object} metadata of AppServiceCertificateOrder + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceCertificateOrder', + type: { + name: 'Composite', + className: 'AppServiceCertificateOrder', + 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' + } + } + } + }, + certificates: { + required: false, + serializedName: 'properties.certificates', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AppServiceCertificateElementType', + type: { + name: 'Composite', + className: 'AppServiceCertificate' + } + } + } + }, + distinguishedName: { + required: false, + serializedName: 'properties.distinguishedName', + type: { + name: 'String' + } + }, + domainVerificationToken: { + required: false, + readOnly: true, + serializedName: 'properties.domainVerificationToken', + type: { + name: 'String' + } + }, + validityInYears: { + required: false, + serializedName: 'properties.validityInYears', + defaultValue: 1, + constraints: { + InclusiveMaximum: 3, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + keySize: { + required: false, + serializedName: 'properties.keySize', + defaultValue: 2048, + type: { + name: 'Number' + } + }, + productType: { + required: true, + serializedName: 'properties.productType', + type: { + name: 'Enum', + allowedValues: [ 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' ] + } + }, + autoRenew: { + required: false, + serializedName: 'properties.autoRenew', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + 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: [ 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted' ] + } + }, + signedCertificate: { + required: false, + readOnly: true, + serializedName: 'properties.signedCertificate', + type: { + name: 'Composite', + className: 'CertificateDetails' + } + }, + csr: { + required: false, + serializedName: 'properties.csr', + type: { + name: 'String' + } + }, + intermediate: { + required: false, + readOnly: true, + serializedName: 'properties.intermediate', + type: { + name: 'Composite', + className: 'CertificateDetails' + } + }, + root: { + required: false, + readOnly: true, + serializedName: 'properties.root', + type: { + name: 'Composite', + className: 'CertificateDetails' + } + }, + serialNumber: { + required: false, + readOnly: true, + serializedName: 'properties.serialNumber', + type: { + name: 'String' + } + }, + lastCertificateIssuanceTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastCertificateIssuanceTime', + type: { + name: 'DateTime' + } + }, + expirationTime: { + required: false, + readOnly: true, + serializedName: 'properties.expirationTime', + type: { + name: 'DateTime' + } + }, + isPrivateKeyExternal: { + required: false, + readOnly: true, + serializedName: 'properties.isPrivateKeyExternal', + type: { + name: 'Boolean' + } + }, + appServiceCertificateNotRenewableReasons: { + required: false, + readOnly: true, + serializedName: 'properties.appServiceCertificateNotRenewableReasons', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + nextAutoRenewalTimeStamp: { + required: false, + readOnly: true, + serializedName: 'properties.nextAutoRenewalTimeStamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = AppServiceCertificateOrder; diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderCollection.js b/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderCollection.js new file mode 100644 index 0000000000..6f45eabab2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderCollection.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 certitificate orders. + */ +class AppServiceCertificateOrderCollection extends Array { + /** + * Create a AppServiceCertificateOrderCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceCertificateOrderCollection + * + * @returns {object} metadata of AppServiceCertificateOrderCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceCertificateOrderCollection', + type: { + name: 'Composite', + className: 'AppServiceCertificateOrderCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AppServiceCertificateOrderElementType', + type: { + name: 'Composite', + className: 'AppServiceCertificateOrder' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppServiceCertificateOrderCollection; diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderPatchResource.js b/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderPatchResource.js new file mode 100644 index 0000000000..2601b56004 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderPatchResource.js @@ -0,0 +1,316 @@ +/* + * 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 order that is purchased through Azure. + * + * @extends models['ProxyOnlyResource'] + */ +class AppServiceCertificateOrderPatchResource extends models['ProxyOnlyResource'] { + /** + * Create a AppServiceCertificateOrderPatchResource. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceCertificateOrderPatchResource + * + * @returns {object} metadata of AppServiceCertificateOrderPatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceCertificateOrderPatchResource', + type: { + name: 'Composite', + className: 'AppServiceCertificateOrderPatchResource', + 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' + } + }, + certificates: { + required: false, + serializedName: 'properties.certificates', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AppServiceCertificateElementType', + type: { + name: 'Composite', + className: 'AppServiceCertificate' + } + } + } + }, + distinguishedName: { + required: false, + serializedName: 'properties.distinguishedName', + type: { + name: 'String' + } + }, + domainVerificationToken: { + required: false, + readOnly: true, + serializedName: 'properties.domainVerificationToken', + type: { + name: 'String' + } + }, + validityInYears: { + required: false, + serializedName: 'properties.validityInYears', + defaultValue: 1, + constraints: { + InclusiveMaximum: 3, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + keySize: { + required: false, + serializedName: 'properties.keySize', + defaultValue: 2048, + type: { + name: 'Number' + } + }, + productType: { + required: true, + serializedName: 'properties.productType', + type: { + name: 'Enum', + allowedValues: [ 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' ] + } + }, + autoRenew: { + required: false, + serializedName: 'properties.autoRenew', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + 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: [ 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted' ] + } + }, + signedCertificate: { + required: false, + readOnly: true, + serializedName: 'properties.signedCertificate', + type: { + name: 'Composite', + className: 'CertificateDetails' + } + }, + csr: { + required: false, + serializedName: 'properties.csr', + type: { + name: 'String' + } + }, + intermediate: { + required: false, + readOnly: true, + serializedName: 'properties.intermediate', + type: { + name: 'Composite', + className: 'CertificateDetails' + } + }, + root: { + required: false, + readOnly: true, + serializedName: 'properties.root', + type: { + name: 'Composite', + className: 'CertificateDetails' + } + }, + serialNumber: { + required: false, + readOnly: true, + serializedName: 'properties.serialNumber', + type: { + name: 'String' + } + }, + lastCertificateIssuanceTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastCertificateIssuanceTime', + type: { + name: 'DateTime' + } + }, + expirationTime: { + required: false, + readOnly: true, + serializedName: 'properties.expirationTime', + type: { + name: 'DateTime' + } + }, + isPrivateKeyExternal: { + required: false, + readOnly: true, + serializedName: 'properties.isPrivateKeyExternal', + type: { + name: 'Boolean' + } + }, + appServiceCertificateNotRenewableReasons: { + required: false, + readOnly: true, + serializedName: 'properties.appServiceCertificateNotRenewableReasons', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + nextAutoRenewalTimeStamp: { + required: false, + readOnly: true, + serializedName: 'properties.nextAutoRenewalTimeStamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = AppServiceCertificateOrderPatchResource; diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificatePatchResource.js b/lib/services/websiteManagement2/lib/models/appServiceCertificatePatchResource.js new file mode 100644 index 0000000000..6abc5ec0e5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificatePatchResource.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'); + +/** + * Key Vault container ARM resource for a certificate that is purchased through + * Azure. + * + * @extends models['ProxyOnlyResource'] + */ +class AppServiceCertificatePatchResource extends models['ProxyOnlyResource'] { + /** + * Create a AppServiceCertificatePatchResource. + * @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' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceCertificatePatchResource + * + * @returns {object} metadata of AppServiceCertificatePatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceCertificatePatchResource', + type: { + name: 'Composite', + className: 'AppServiceCertificatePatchResource', + 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' + } + }, + keyVaultId: { + required: false, + serializedName: 'properties.keyVaultId', + type: { + name: 'String' + } + }, + keyVaultSecretName: { + required: false, + serializedName: 'properties.keyVaultSecretName', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] + } + } + } + } + }; + } +} + +module.exports = AppServiceCertificatePatchResource; diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificateResource.js b/lib/services/websiteManagement2/lib/models/appServiceCertificateResource.js new file mode 100644 index 0000000000..b55a592086 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificateResource.js @@ -0,0 +1,132 @@ +/* + * 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'); + +/** + * Key Vault container ARM resource for a certificate that is purchased through + * Azure. + * + * @extends models['Resource'] + */ +class AppServiceCertificateResource extends models['Resource'] { + /** + * Create a AppServiceCertificateResource. + * @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' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceCertificateResource + * + * @returns {object} metadata of AppServiceCertificateResource + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceCertificateResource', + type: { + name: 'Composite', + className: 'AppServiceCertificateResource', + 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' + } + } + } + }, + keyVaultId: { + required: false, + serializedName: 'properties.keyVaultId', + type: { + name: 'String' + } + }, + keyVaultSecretName: { + required: false, + serializedName: 'properties.keyVaultSecretName', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] + } + } + } + } + }; + } +} + +module.exports = AppServiceCertificateResource; 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/appServiceEnvironmentCollection.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentCollection.js new file mode 100644 index 0000000000..7c44f399b6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentCollection.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 Environments. + */ +class AppServiceEnvironmentCollection extends Array { + /** + * Create a AppServiceEnvironmentCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceEnvironmentCollection + * + * @returns {object} metadata of AppServiceEnvironmentCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceEnvironmentCollection', + type: { + name: 'Composite', + className: 'AppServiceEnvironmentCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AppServiceEnvironmentResourceElementType', + type: { + name: 'Composite', + className: 'AppServiceEnvironmentResource' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppServiceEnvironmentCollection; 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..52f4a0c0fb --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServicePlan.js @@ -0,0 +1,327 @@ +/* + * 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} [maximumElasticWorkerCount] Maximum number of total + * workers allowed for this ElasticScaleEnabled App Service Plan + * @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' + } + }, + maximumElasticWorkerCount: { + required: false, + serializedName: 'properties.maximumElasticWorkerCount', + type: { + name: 'Number' + } + }, + 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..d16dc241df --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js @@ -0,0 +1,278 @@ +/* + * 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} [maximumElasticWorkerCount] Maximum number of total + * workers allowed for this ElasticScaleEnabled App Service Plan + * @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' + } + }, + maximumElasticWorkerCount: { + required: false, + serializedName: 'properties.maximumElasticWorkerCount', + type: { + name: 'Number' + } + }, + 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 new file mode 100644 index 0000000000..ab1e59ff5f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/applicationLogsConfig.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'; + +/** + * Application logs configuration. + * + */ +class ApplicationLogsConfig { + /** + * Create a ApplicationLogsConfig. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationLogsConfig + * + * @returns {object} metadata of ApplicationLogsConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationLogsConfig', + type: { + name: 'Composite', + className: 'ApplicationLogsConfig', + modelProperties: { + fileSystem: { + required: false, + serializedName: 'fileSystem', + type: { + name: 'Composite', + className: 'FileSystemApplicationLogsConfig' + } + }, + azureTableStorage: { + required: false, + serializedName: 'azureTableStorage', + type: { + name: 'Composite', + className: 'AzureTableStorageApplicationLogsConfig' + } + }, + azureBlobStorage: { + required: false, + serializedName: 'azureBlobStorage', + type: { + name: 'Composite', + className: 'AzureBlobStorageApplicationLogsConfig' + } + } + } + } + }; + } +} + +module.exports = ApplicationLogsConfig; diff --git a/lib/services/websiteManagement2/lib/models/applicationStack.js b/lib/services/websiteManagement2/lib/models/applicationStack.js new file mode 100644 index 0000000000..50974c2600 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/applicationStack.js @@ -0,0 +1,101 @@ +/* + * 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'; + +/** + * Application stack. + * + */ +class ApplicationStack { + /** + * Create a ApplicationStack. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationStack + * + * @returns {object} metadata of ApplicationStack + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationStack', + type: { + name: 'Composite', + className: 'ApplicationStack', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'String' + } + }, + dependency: { + required: false, + serializedName: 'dependency', + type: { + name: 'String' + } + }, + majorVersions: { + required: false, + serializedName: 'majorVersions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StackMajorVersionElementType', + type: { + name: 'Composite', + className: 'StackMajorVersion' + } + } + } + }, + frameworks: { + required: false, + serializedName: 'frameworks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationStackElementType', + type: { + name: 'Composite', + className: 'ApplicationStack' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationStack; diff --git a/lib/services/websiteManagement2/lib/models/applicationStackCollection.js b/lib/services/websiteManagement2/lib/models/applicationStackCollection.js new file mode 100644 index 0000000000..03e5ff0ee5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/applicationStackCollection.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 Application Stacks + */ +class ApplicationStackCollection extends Array { + /** + * Create a ApplicationStackCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationStackCollection + * + * @returns {object} metadata of ApplicationStackCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationStackCollection', + type: { + name: 'Composite', + className: 'ApplicationStackCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationStackElementType', + type: { + name: 'Composite', + className: 'ApplicationStack' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationStackCollection; diff --git a/lib/services/websiteManagement2/lib/models/autoHealActions.js b/lib/services/websiteManagement2/lib/models/autoHealActions.js new file mode 100644 index 0000000000..87cba99f34 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/autoHealActions.js @@ -0,0 +1,75 @@ +/* + * 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'; + +/** + * Actions which to take by the auto-heal module when a rule is triggered. + * + */ +class AutoHealActions { + /** + * Create a AutoHealActions. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of AutoHealActions + * + * @returns {object} metadata of AutoHealActions + * + */ + mapper() { + return { + required: false, + serializedName: 'AutoHealActions', + type: { + name: 'Composite', + className: 'AutoHealActions', + modelProperties: { + actionType: { + required: false, + serializedName: 'actionType', + type: { + name: 'Enum', + allowedValues: [ 'Recycle', 'LogEvent', 'CustomAction' ] + } + }, + customAction: { + required: false, + serializedName: 'customAction', + type: { + name: 'Composite', + className: 'AutoHealCustomAction' + } + }, + minProcessExecutionTime: { + required: false, + serializedName: 'minProcessExecutionTime', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AutoHealActions; diff --git a/lib/services/websiteManagement2/lib/models/autoHealCustomAction.js b/lib/services/websiteManagement2/lib/models/autoHealCustomAction.js new file mode 100644 index 0000000000..d60d7dc348 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/autoHealCustomAction.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Custom action to be executed + * when an auto heal rule is triggered. + * + */ +class AutoHealCustomAction { + /** + * Create a AutoHealCustomAction. + * @member {string} [exe] Executable to be run. + * @member {string} [parameters] Parameters for the executable. + */ + constructor() { + } + + /** + * Defines the metadata of AutoHealCustomAction + * + * @returns {object} metadata of AutoHealCustomAction + * + */ + mapper() { + return { + required: false, + serializedName: 'AutoHealCustomAction', + type: { + name: 'Composite', + className: 'AutoHealCustomAction', + modelProperties: { + exe: { + required: false, + serializedName: 'exe', + type: { + name: 'String' + } + }, + parameters: { + required: false, + serializedName: 'parameters', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AutoHealCustomAction; diff --git a/lib/services/websiteManagement2/lib/models/autoHealRules.js b/lib/services/websiteManagement2/lib/models/autoHealRules.js new file mode 100644 index 0000000000..d2975a1396 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/autoHealRules.js @@ -0,0 +1,84 @@ +/* + * 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'; + +/** + * Rules that can be defined for auto-heal. + * + */ +class AutoHealRules { + /** + * Create a AutoHealRules. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of AutoHealRules + * + * @returns {object} metadata of AutoHealRules + * + */ + mapper() { + return { + required: false, + serializedName: 'AutoHealRules', + type: { + name: 'Composite', + className: 'AutoHealRules', + modelProperties: { + triggers: { + required: false, + serializedName: 'triggers', + type: { + name: 'Composite', + className: 'AutoHealTriggers' + } + }, + actions: { + required: false, + serializedName: 'actions', + type: { + name: 'Composite', + className: 'AutoHealActions' + } + } + } + } + }; + } +} + +module.exports = AutoHealRules; diff --git a/lib/services/websiteManagement2/lib/models/autoHealTriggers.js b/lib/services/websiteManagement2/lib/models/autoHealTriggers.js new file mode 100644 index 0000000000..f14f8dd067 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/autoHealTriggers.js @@ -0,0 +1,91 @@ +/* + * 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'; + +/** + * Triggers for auto-heal. + * + */ +class AutoHealTriggers { + /** + * Create a AutoHealTriggers. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of AutoHealTriggers + * + * @returns {object} metadata of AutoHealTriggers + * + */ + mapper() { + return { + required: false, + serializedName: 'AutoHealTriggers', + type: { + name: 'Composite', + className: 'AutoHealTriggers', + modelProperties: { + requests: { + required: false, + serializedName: 'requests', + type: { + name: 'Composite', + className: 'RequestsBasedTrigger' + } + }, + privateBytesInKB: { + required: false, + serializedName: 'privateBytesInKB', + type: { + name: 'Number' + } + }, + statusCodes: { + required: false, + serializedName: 'statusCodes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StatusCodesBasedTriggerElementType', + type: { + name: 'Composite', + className: 'StatusCodesBasedTrigger' + } + } + } + }, + slowRequests: { + required: false, + serializedName: 'slowRequests', + type: { + name: 'Composite', + className: 'SlowRequestsBasedTrigger' + } + } + } + } + }; + } +} + +module.exports = AutoHealTriggers; diff --git a/lib/services/websiteManagement2/lib/models/azureBlobStorageApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/models/azureBlobStorageApplicationLogsConfig.js new file mode 100644 index 0000000000..34571a8b2d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/azureBlobStorageApplicationLogsConfig.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * Application logs azure blob storage configuration. + * + */ +class AzureBlobStorageApplicationLogsConfig { + /** + * Create a AzureBlobStorageApplicationLogsConfig. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of AzureBlobStorageApplicationLogsConfig + * + * @returns {object} metadata of AzureBlobStorageApplicationLogsConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureBlobStorageApplicationLogsConfig', + type: { + name: 'Composite', + className: 'AzureBlobStorageApplicationLogsConfig', + modelProperties: { + level: { + required: false, + serializedName: 'level', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'Verbose', 'Information', 'Warning', 'Error' ] + } + }, + sasUrl: { + required: false, + serializedName: 'sasUrl', + type: { + name: 'String' + } + }, + retentionInDays: { + required: false, + serializedName: 'retentionInDays', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AzureBlobStorageApplicationLogsConfig; diff --git a/lib/services/websiteManagement2/lib/models/azureBlobStorageHttpLogsConfig.js b/lib/services/websiteManagement2/lib/models/azureBlobStorageHttpLogsConfig.js new file mode 100644 index 0000000000..e7d85bf50e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/azureBlobStorageHttpLogsConfig.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Http logs to azure blob storage configuration. + * + */ +class AzureBlobStorageHttpLogsConfig { + /** + * Create a AzureBlobStorageHttpLogsConfig. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of AzureBlobStorageHttpLogsConfig + * + * @returns {object} metadata of AzureBlobStorageHttpLogsConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureBlobStorageHttpLogsConfig', + type: { + name: 'Composite', + className: 'AzureBlobStorageHttpLogsConfig', + modelProperties: { + sasUrl: { + required: false, + serializedName: 'sasUrl', + type: { + name: 'String' + } + }, + retentionInDays: { + required: false, + serializedName: 'retentionInDays', + type: { + name: 'Number' + } + }, + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = AzureBlobStorageHttpLogsConfig; 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/azureTableStorageApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/models/azureTableStorageApplicationLogsConfig.js new file mode 100644 index 0000000000..ae109442ed --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/azureTableStorageApplicationLogsConfig.js @@ -0,0 +1,63 @@ +/* + * 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'; + +/** + * Application logs to Azure table storage configuration. + * + */ +class AzureTableStorageApplicationLogsConfig { + /** + * Create a AzureTableStorageApplicationLogsConfig. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of AzureTableStorageApplicationLogsConfig + * + * @returns {object} metadata of AzureTableStorageApplicationLogsConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureTableStorageApplicationLogsConfig', + type: { + name: 'Composite', + className: 'AzureTableStorageApplicationLogsConfig', + modelProperties: { + level: { + required: false, + serializedName: 'level', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'Verbose', 'Information', 'Warning', 'Error' ] + } + }, + sasUrl: { + required: true, + serializedName: 'sasUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureTableStorageApplicationLogsConfig; diff --git a/lib/services/websiteManagement2/lib/models/backupItem.js b/lib/services/websiteManagement2/lib/models/backupItem.js new file mode 100644 index 0000000000..abff5af787 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/backupItem.js @@ -0,0 +1,223 @@ +/* + * 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'); + +/** + * Backup description. + * + * @extends models['ProxyOnlyResource'] + */ +class BackupItem extends models['ProxyOnlyResource'] { + /** + * Create a BackupItem. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BackupItem + * + * @returns {object} metadata of BackupItem + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupItem', + type: { + name: 'Composite', + className: 'BackupItem', + 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' + } + }, + backupId: { + required: false, + readOnly: true, + serializedName: 'properties.id', + type: { + name: 'Number' + } + }, + storageAccountUrl: { + required: false, + readOnly: true, + serializedName: 'properties.storageAccountUrl', + type: { + name: 'String' + } + }, + blobName: { + required: false, + readOnly: true, + serializedName: 'properties.blobName', + type: { + name: 'String' + } + }, + backupItemName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created', 'Skipped', 'PartiallySucceeded', 'DeleteInProgress', 'DeleteFailed', 'Deleted' ] + } + }, + sizeInBytes: { + required: false, + readOnly: true, + serializedName: 'properties.sizeInBytes', + type: { + name: 'Number' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'properties.created', + type: { + name: 'DateTime' + } + }, + log: { + required: false, + readOnly: true, + serializedName: 'properties.log', + type: { + name: 'String' + } + }, + databases: { + required: false, + readOnly: true, + serializedName: 'properties.databases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseBackupSettingElementType', + type: { + name: 'Composite', + className: 'DatabaseBackupSetting' + } + } + } + }, + scheduled: { + required: false, + readOnly: true, + serializedName: 'properties.scheduled', + type: { + name: 'Boolean' + } + }, + lastRestoreTimeStamp: { + required: false, + readOnly: true, + serializedName: 'properties.lastRestoreTimeStamp', + type: { + name: 'DateTime' + } + }, + finishedTimeStamp: { + required: false, + readOnly: true, + serializedName: 'properties.finishedTimeStamp', + type: { + name: 'DateTime' + } + }, + correlationId: { + required: false, + readOnly: true, + serializedName: 'properties.correlationId', + type: { + name: 'String' + } + }, + websiteSizeInBytes: { + required: false, + readOnly: true, + serializedName: 'properties.websiteSizeInBytes', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = BackupItem; diff --git a/lib/services/websiteManagement2/lib/models/backupItemCollection.js b/lib/services/websiteManagement2/lib/models/backupItemCollection.js new file mode 100644 index 0000000000..769f26fe98 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/backupItemCollection.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 backup items. + */ +class BackupItemCollection extends Array { + /** + * Create a BackupItemCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BackupItemCollection + * + * @returns {object} metadata of BackupItemCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupItemCollection', + type: { + name: 'Composite', + className: 'BackupItemCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackupItemElementType', + type: { + name: 'Composite', + className: 'BackupItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackupItemCollection; 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/backupSchedule.js b/lib/services/websiteManagement2/lib/models/backupSchedule.js new file mode 100644 index 0000000000..b8d86ca61a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/backupSchedule.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'; + +/** + * Description of a backup schedule. Describes how often should be the backup + * performed and what should be the retention policy. + * + */ +class BackupSchedule { + /** + * Create a BackupSchedule. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of BackupSchedule + * + * @returns {object} metadata of BackupSchedule + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupSchedule', + type: { + name: 'Composite', + className: 'BackupSchedule', + modelProperties: { + frequencyInterval: { + required: true, + serializedName: 'frequencyInterval', + defaultValue: 7, + type: { + name: 'Number' + } + }, + frequencyUnit: { + required: true, + serializedName: 'frequencyUnit', + defaultValue: 'Day', + type: { + name: 'Enum', + allowedValues: [ 'Day', 'Hour' ] + } + }, + keepAtLeastOneBackup: { + required: true, + serializedName: 'keepAtLeastOneBackup', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + retentionPeriodInDays: { + required: true, + serializedName: 'retentionPeriodInDays', + defaultValue: 30, + type: { + name: 'Number' + } + }, + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + lastExecutionTime: { + required: false, + readOnly: true, + serializedName: 'lastExecutionTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = BackupSchedule; diff --git a/lib/services/websiteManagement2/lib/models/billingMeter.js b/lib/services/websiteManagement2/lib/models/billingMeter.js new file mode 100644 index 0000000000..aba6effb23 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/billingMeter.js @@ -0,0 +1,129 @@ +/* + * 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 billing entity that contains information about meter which the + * Azure billing system utilizes to charge users for services. + * + * @extends models['ProxyOnlyResource'] + */ +class BillingMeter extends models['ProxyOnlyResource'] { + /** + * Create a BillingMeter. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BillingMeter + * + * @returns {object} metadata of BillingMeter + * + */ + mapper() { + return { + required: false, + serializedName: 'BillingMeter', + type: { + name: 'Composite', + className: 'BillingMeter', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + meterId: { + required: false, + serializedName: 'properties.meterId', + type: { + name: 'String' + } + }, + billingLocation: { + required: false, + serializedName: 'properties.billingLocation', + type: { + name: 'String' + } + }, + shortName: { + required: false, + serializedName: 'properties.shortName', + type: { + name: 'String' + } + }, + friendlyName: { + required: false, + serializedName: 'properties.friendlyName', + type: { + name: 'String' + } + }, + resourceType: { + required: false, + serializedName: 'properties.resourceType', + type: { + name: 'String' + } + }, + osType: { + required: false, + serializedName: 'properties.osType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BillingMeter; diff --git a/lib/services/websiteManagement2/lib/models/billingMeterCollection.js b/lib/services/websiteManagement2/lib/models/billingMeterCollection.js new file mode 100644 index 0000000000..731a97562d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/billingMeterCollection.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Collection of Billing Meters + */ +class BillingMeterCollection extends Array { + /** + * Create a BillingMeterCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BillingMeterCollection + * + * @returns {object} metadata of BillingMeterCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'BillingMeterCollection', + type: { + name: 'Composite', + className: 'BillingMeterCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BillingMeterElementType', + type: { + name: 'Composite', + className: 'BillingMeter' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BillingMeterCollection; diff --git a/lib/services/websiteManagement2/lib/models/capability.js b/lib/services/websiteManagement2/lib/models/capability.js new file mode 100644 index 0000000000..1d81f3149e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/capability.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'; + +/** + * Describes the capabilities/features allowed for a specific SKU. + * + */ +class Capability { + /** + * Create a Capability. + * @member {string} [name] Name of the SKU capability. + * @member {string} [value] Value of the SKU capability. + * @member {string} [reason] Reason of the SKU capability. + */ + constructor() { + } + + /** + * Defines the metadata of Capability + * + * @returns {object} metadata of Capability + * + */ + mapper() { + return { + required: false, + serializedName: 'Capability', + type: { + name: 'Composite', + className: 'Capability', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Capability; 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/certificateCollection.js b/lib/services/websiteManagement2/lib/models/certificateCollection.js new file mode 100644 index 0000000000..43f9fd446c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificateCollection.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 certificates. + */ +class CertificateCollection extends Array { + /** + * Create a CertificateCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CertificateCollection + * + * @returns {object} metadata of CertificateCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateCollection', + type: { + name: 'Composite', + className: 'CertificateCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CertificateElementType', + type: { + name: 'Composite', + className: 'Certificate' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificateCollection; diff --git a/lib/services/websiteManagement2/lib/models/certificateDetails.js b/lib/services/websiteManagement2/lib/models/certificateDetails.js new file mode 100644 index 0000000000..affae5c9fc --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificateDetails.js @@ -0,0 +1,125 @@ +/* + * 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'; + +/** + * SSL certificate details. + * + */ +class CertificateDetails { + /** + * Create a CertificateDetails. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateDetails + * + * @returns {object} metadata of CertificateDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateDetails', + type: { + name: 'Composite', + className: 'CertificateDetails', + modelProperties: { + version: { + required: false, + readOnly: true, + serializedName: 'version', + type: { + name: 'Number' + } + }, + serialNumber: { + required: false, + readOnly: true, + serializedName: 'serialNumber', + type: { + name: 'String' + } + }, + thumbprint: { + required: false, + readOnly: true, + serializedName: 'thumbprint', + type: { + name: 'String' + } + }, + subject: { + required: false, + readOnly: true, + serializedName: 'subject', + type: { + name: 'String' + } + }, + notBefore: { + required: false, + readOnly: true, + serializedName: 'notBefore', + type: { + name: 'DateTime' + } + }, + notAfter: { + required: false, + readOnly: true, + serializedName: 'notAfter', + type: { + name: 'DateTime' + } + }, + signatureAlgorithm: { + required: false, + readOnly: true, + serializedName: 'signatureAlgorithm', + type: { + name: 'String' + } + }, + issuer: { + required: false, + readOnly: true, + serializedName: 'issuer', + type: { + name: 'String' + } + }, + rawData: { + required: false, + readOnly: true, + serializedName: 'rawData', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificateDetails; diff --git a/lib/services/websiteManagement2/lib/models/certificateEmail.js b/lib/services/websiteManagement2/lib/models/certificateEmail.js new file mode 100644 index 0000000000..5ffdc8fae5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificateEmail.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'); + +/** + * SSL certificate email. + * + * @extends models['ProxyOnlyResource'] + */ +class CertificateEmail extends models['ProxyOnlyResource'] { + /** + * Create a CertificateEmail. + * @member {string} [emailId] Email id. + * @member {date} [timeStamp] Time stamp. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CertificateEmail + * + * @returns {object} metadata of CertificateEmail + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateEmail', + type: { + name: 'Composite', + className: 'CertificateEmail', + 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' + } + }, + emailId: { + required: false, + serializedName: 'properties.emailId', + type: { + name: 'String' + } + }, + timeStamp: { + required: false, + serializedName: 'properties.timeStamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = CertificateEmail; 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/connStringInfo.js b/lib/services/websiteManagement2/lib/models/connStringInfo.js new file mode 100644 index 0000000000..e45a358633 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/connStringInfo.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Database connection string information. + * + */ +class ConnStringInfo { + /** + * Create a ConnStringInfo. + * @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' + */ + constructor() { + } + + /** + * Defines the metadata of ConnStringInfo + * + * @returns {object} metadata of ConnStringInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnStringInfo', + type: { + name: 'Composite', + className: 'ConnStringInfo', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + connectionString: { + required: false, + serializedName: 'connectionString', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'MySql', 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' ] + } + } + } + } + }; + } +} + +module.exports = ConnStringInfo; diff --git a/lib/services/websiteManagement2/lib/models/connStringValueTypePair.js b/lib/services/websiteManagement2/lib/models/connStringValueTypePair.js new file mode 100644 index 0000000000..b2d1bf7ca1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/connStringValueTypePair.js @@ -0,0 +1,63 @@ +/* + * 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'; + +/** + * Database connection string value to type pair. + * + */ +class ConnStringValueTypePair { + /** + * Create a ConnStringValueTypePair. + * @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' + */ + constructor() { + } + + /** + * Defines the metadata of ConnStringValueTypePair + * + * @returns {object} metadata of ConnStringValueTypePair + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnStringValueTypePair', + type: { + name: 'Composite', + className: 'ConnStringValueTypePair', + modelProperties: { + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'MySql', 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' ] + } + } + } + } + }; + } +} + +module.exports = ConnStringValueTypePair; diff --git a/lib/services/websiteManagement2/lib/models/connectionStringDictionary.js b/lib/services/websiteManagement2/lib/models/connectionStringDictionary.js new file mode 100644 index 0000000000..4166de86d0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/connectionStringDictionary.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'); + +/** + * String dictionary resource. + * + * @extends models['ProxyOnlyResource'] + */ +class ConnectionStringDictionary extends models['ProxyOnlyResource'] { + /** + * Create a ConnectionStringDictionary. + * @member {object} [properties] Connection strings. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectionStringDictionary + * + * @returns {object} metadata of ConnectionStringDictionary + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionStringDictionary', + type: { + name: 'Composite', + className: 'ConnectionStringDictionary', + 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: 'ConnStringValueTypePairElementType', + type: { + name: 'Composite', + className: 'ConnStringValueTypePair' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectionStringDictionary; diff --git a/lib/services/websiteManagement2/lib/models/contact.js b/lib/services/websiteManagement2/lib/models/contact.js new file mode 100644 index 0000000000..d566aebb48 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/contact.js @@ -0,0 +1,129 @@ +/* + * 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'; + +/** + * 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. + * + */ +class Contact { + /** + * Create a Contact. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of Contact + * + * @returns {object} metadata of Contact + * + */ + mapper() { + return { + required: false, + serializedName: 'Contact', + type: { + name: 'Composite', + className: 'Contact', + modelProperties: { + addressMailing: { + required: false, + serializedName: 'addressMailing', + type: { + name: 'Composite', + className: 'Address' + } + }, + email: { + required: true, + serializedName: 'email', + type: { + name: 'String' + } + }, + fax: { + required: false, + serializedName: 'fax', + type: { + name: 'String' + } + }, + jobTitle: { + required: false, + serializedName: 'jobTitle', + type: { + name: 'String' + } + }, + nameFirst: { + required: true, + serializedName: 'nameFirst', + type: { + name: 'String' + } + }, + nameLast: { + required: true, + serializedName: 'nameLast', + type: { + name: 'String' + } + }, + nameMiddle: { + required: false, + serializedName: 'nameMiddle', + type: { + name: 'String' + } + }, + organization: { + required: false, + serializedName: 'organization', + type: { + name: 'String' + } + }, + phone: { + required: true, + serializedName: 'phone', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Contact; 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/corsSettings.js b/lib/services/websiteManagement2/lib/models/corsSettings.js new file mode 100644 index 0000000000..888cff3aac --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/corsSettings.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Cross-Origin Resource Sharing (CORS) settings for the app. + * + */ +class CorsSettings { + /** + * Create a CorsSettings. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of CorsSettings + * + * @returns {object} metadata of CorsSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'CorsSettings', + type: { + name: 'Composite', + className: 'CorsSettings', + modelProperties: { + allowedOrigins: { + required: false, + serializedName: 'allowedOrigins', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CorsSettings; diff --git a/lib/services/websiteManagement2/lib/models/csmMoveResourceEnvelope.js b/lib/services/websiteManagement2/lib/models/csmMoveResourceEnvelope.js new file mode 100644 index 0000000000..fef33a9910 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmMoveResourceEnvelope.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * Object with a list of the resources that need to be moved and the resource + * group they should be moved to. + * + */ +class CsmMoveResourceEnvelope { + /** + * Create a CsmMoveResourceEnvelope. + * @member {string} [targetResourceGroup] + * @member {array} [resources] + */ + constructor() { + } + + /** + * Defines the metadata of CsmMoveResourceEnvelope + * + * @returns {object} metadata of CsmMoveResourceEnvelope + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmMoveResourceEnvelope', + type: { + name: 'Composite', + className: 'CsmMoveResourceEnvelope', + modelProperties: { + targetResourceGroup: { + required: false, + serializedName: 'targetResourceGroup', + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: ' ^[-\w\._\(\)]+[^\.]$' + }, + type: { + name: 'String' + } + }, + resources: { + required: false, + serializedName: 'resources', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CsmMoveResourceEnvelope; diff --git a/lib/services/websiteManagement2/lib/models/csmOperationCollection.js b/lib/services/websiteManagement2/lib/models/csmOperationCollection.js new file mode 100644 index 0000000000..24c2e9b665 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmOperationCollection.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 Azure resource manager operation metadata. + */ +class CsmOperationCollection extends Array { + /** + * Create a CsmOperationCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CsmOperationCollection + * + * @returns {object} metadata of CsmOperationCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmOperationCollection', + type: { + name: 'Composite', + className: 'CsmOperationCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CsmOperationDescriptionElementType', + type: { + name: 'Composite', + className: 'CsmOperationDescription' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CsmOperationCollection; 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/csmOperationDisplay.js b/lib/services/websiteManagement2/lib/models/csmOperationDisplay.js new file mode 100644 index 0000000000..fa90f6c44d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmOperationDisplay.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'; + +/** + * Meta data about operation used for display in portal. + * + */ +class CsmOperationDisplay { + /** + * Create a CsmOperationDisplay. + * @member {string} [provider] + * @member {string} [resource] + * @member {string} [operation] + * @member {string} [description] + */ + constructor() { + } + + /** + * Defines the metadata of CsmOperationDisplay + * + * @returns {object} metadata of CsmOperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmOperationDisplay', + type: { + name: 'Composite', + className: 'CsmOperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CsmOperationDisplay; diff --git a/lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.js b/lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.js new file mode 100644 index 0000000000..2ff11f2d9c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Publishing options for requested profile. + * + */ +class CsmPublishingProfileOptions { + /** + * Create a CsmPublishingProfileOptions. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of CsmPublishingProfileOptions + * + * @returns {object} metadata of CsmPublishingProfileOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmPublishingProfileOptions', + type: { + name: 'Composite', + className: 'CsmPublishingProfileOptions', + modelProperties: { + format: { + required: false, + serializedName: 'format', + type: { + name: 'String' + } + }, + includeDisasterRecoveryEndpoints: { + required: false, + serializedName: 'includeDisasterRecoveryEndpoints', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = CsmPublishingProfileOptions; diff --git a/lib/services/websiteManagement2/lib/models/csmSlotEntity.js b/lib/services/websiteManagement2/lib/models/csmSlotEntity.js new file mode 100644 index 0000000000..286ea2fdd5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmSlotEntity.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Deployment slot parameters. + * + */ +class CsmSlotEntity { + /** + * Create a CsmSlotEntity. + * @member {string} targetSlot Destination deployment slot during swap + * operation. + * @member {boolean} preserveVnet true to preserve Virtual + * Network to the slot during swap; otherwise, false. + */ + constructor() { + } + + /** + * Defines the metadata of CsmSlotEntity + * + * @returns {object} metadata of CsmSlotEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmSlotEntity', + type: { + name: 'Composite', + className: 'CsmSlotEntity', + modelProperties: { + targetSlot: { + required: true, + serializedName: 'targetSlot', + type: { + name: 'String' + } + }, + preserveVnet: { + required: true, + serializedName: 'preserveVnet', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = CsmSlotEntity; diff --git a/lib/services/websiteManagement2/lib/models/csmUsageQuota.js b/lib/services/websiteManagement2/lib/models/csmUsageQuota.js new file mode 100644 index 0000000000..6a7322c0d3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmUsageQuota.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'; + +/** + * Usage of the quota resource. + * + */ +class CsmUsageQuota { + /** + * Create a CsmUsageQuota. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of CsmUsageQuota + * + * @returns {object} metadata of CsmUsageQuota + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmUsageQuota', + type: { + name: 'Composite', + className: 'CsmUsageQuota', + modelProperties: { + unit: { + required: false, + serializedName: 'unit', + type: { + name: 'String' + } + }, + nextResetTime: { + required: false, + serializedName: 'nextResetTime', + type: { + name: 'DateTime' + } + }, + currentValue: { + required: false, + serializedName: 'currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: false, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'Composite', + className: 'LocalizableString' + } + } + } + } + }; + } +} + +module.exports = CsmUsageQuota; diff --git a/lib/services/websiteManagement2/lib/models/csmUsageQuotaCollection.js b/lib/services/websiteManagement2/lib/models/csmUsageQuotaCollection.js new file mode 100644 index 0000000000..80459abab5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmUsageQuotaCollection.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 CSM usage quotas. + */ +class CsmUsageQuotaCollection extends Array { + /** + * Create a CsmUsageQuotaCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CsmUsageQuotaCollection + * + * @returns {object} metadata of CsmUsageQuotaCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmUsageQuotaCollection', + type: { + name: 'Composite', + className: 'CsmUsageQuotaCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CsmUsageQuotaElementType', + type: { + name: 'Composite', + className: 'CsmUsageQuota' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CsmUsageQuotaCollection; diff --git a/lib/services/websiteManagement2/lib/models/customHostnameAnalysisResult.js b/lib/services/websiteManagement2/lib/models/customHostnameAnalysisResult.js new file mode 100644 index 0000000000..e141ca367e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/customHostnameAnalysisResult.js @@ -0,0 +1,232 @@ +/* + * 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'); + +/** + * Custom domain analysis. + * + * @extends models['ProxyOnlyResource'] + */ +class CustomHostnameAnalysisResult extends models['ProxyOnlyResource'] { + /** + * Create a CustomHostnameAnalysisResult. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CustomHostnameAnalysisResult + * + * @returns {object} metadata of CustomHostnameAnalysisResult + * + */ + mapper() { + return { + required: false, + serializedName: 'CustomHostnameAnalysisResult', + type: { + name: 'Composite', + className: 'CustomHostnameAnalysisResult', + 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' + } + }, + isHostnameAlreadyVerified: { + required: false, + readOnly: true, + serializedName: 'properties.isHostnameAlreadyVerified', + type: { + name: 'Boolean' + } + }, + customDomainVerificationTest: { + required: false, + readOnly: true, + serializedName: 'properties.customDomainVerificationTest', + type: { + name: 'Enum', + allowedValues: [ 'Passed', 'Failed', 'Skipped' ] + } + }, + customDomainVerificationFailureInfo: { + required: false, + readOnly: true, + serializedName: 'properties.customDomainVerificationFailureInfo', + type: { + name: 'Composite', + className: 'ErrorEntity' + } + }, + hasConflictOnScaleUnit: { + required: false, + readOnly: true, + serializedName: 'properties.hasConflictOnScaleUnit', + type: { + name: 'Boolean' + } + }, + hasConflictAcrossSubscription: { + required: false, + readOnly: true, + serializedName: 'properties.hasConflictAcrossSubscription', + type: { + name: 'Boolean' + } + }, + conflictingAppResourceId: { + required: false, + readOnly: true, + serializedName: 'properties.conflictingAppResourceId', + type: { + name: 'String' + } + }, + cNameRecords: { + required: false, + serializedName: 'properties.cNameRecords', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + txtRecords: { + required: false, + serializedName: 'properties.txtRecords', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + aRecords: { + required: false, + serializedName: 'properties.aRecords', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + alternateCNameRecords: { + required: false, + serializedName: 'properties.alternateCNameRecords', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + alternateTxtRecords: { + required: false, + serializedName: 'properties.alternateTxtRecords', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = CustomHostnameAnalysisResult; diff --git a/lib/services/websiteManagement2/lib/models/dataSource.js b/lib/services/websiteManagement2/lib/models/dataSource.js new file mode 100644 index 0000000000..480579c108 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/dataSource.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing data source used by the detectors + * + */ +class DataSource { + /** + * Create a DataSource. + * @member {array} [instructions] Instrunctions if any for the data source + * @member {array} [dataSourceUri] Datasource Uri Links + */ + constructor() { + } + + /** + * Defines the metadata of DataSource + * + * @returns {object} metadata of DataSource + * + */ + mapper() { + return { + required: false, + serializedName: 'DataSource', + type: { + name: 'Composite', + className: 'DataSource', + modelProperties: { + instructions: { + required: false, + serializedName: 'instructions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + dataSourceUri: { + required: false, + serializedName: 'dataSourceUri', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + } + } + } + }; + } +} + +module.exports = DataSource; diff --git a/lib/services/websiteManagement2/lib/models/dataTableResponseColumn.js b/lib/services/websiteManagement2/lib/models/dataTableResponseColumn.js new file mode 100644 index 0000000000..0d4f245e13 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/dataTableResponseColumn.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'; + +/** + * Column definition + * + */ +class DataTableResponseColumn { + /** + * Create a DataTableResponseColumn. + * @member {string} [columnName] Name of the column + * @member {string} [dataType] Data type which looks like 'String' or + * 'Int32'. + * @member {string} [columnType] Column Type + */ + constructor() { + } + + /** + * Defines the metadata of DataTableResponseColumn + * + * @returns {object} metadata of DataTableResponseColumn + * + */ + mapper() { + return { + required: false, + serializedName: 'DataTableResponseColumn', + type: { + name: 'Composite', + className: 'DataTableResponseColumn', + modelProperties: { + columnName: { + required: false, + serializedName: 'columnName', + type: { + name: 'String' + } + }, + dataType: { + required: false, + serializedName: 'dataType', + type: { + name: 'String' + } + }, + columnType: { + required: false, + serializedName: 'columnType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DataTableResponseColumn; diff --git a/lib/services/websiteManagement2/lib/models/dataTableResponseObject.js b/lib/services/websiteManagement2/lib/models/dataTableResponseObject.js new file mode 100644 index 0000000000..5120ad3d04 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/dataTableResponseObject.js @@ -0,0 +1,90 @@ +/* + * 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'; + +/** + * Data Table which defines columns and raw row values + * + */ +class DataTableResponseObject { + /** + * Create a DataTableResponseObject. + * @member {string} [tableName] Name of the table + * @member {array} [columns] List of columns with data types + * @member {array} [rows] Raw row values + */ + constructor() { + } + + /** + * Defines the metadata of DataTableResponseObject + * + * @returns {object} metadata of DataTableResponseObject + * + */ + mapper() { + return { + required: false, + serializedName: 'DataTableResponseObject', + type: { + name: 'Composite', + className: 'DataTableResponseObject', + modelProperties: { + tableName: { + required: false, + serializedName: 'tableName', + type: { + name: 'String' + } + }, + columns: { + required: false, + serializedName: 'columns', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DataTableResponseColumnElementType', + type: { + name: 'Composite', + className: 'DataTableResponseColumn' + } + } + } + }, + rows: { + required: false, + serializedName: 'rows', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + } + }; + } +} + +module.exports = DataTableResponseObject; diff --git a/lib/services/websiteManagement2/lib/models/databaseBackupSetting.js b/lib/services/websiteManagement2/lib/models/databaseBackupSetting.js new file mode 100644 index 0000000000..09b9255796 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/databaseBackupSetting.js @@ -0,0 +1,81 @@ +/* + * 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'; + +/** + * Database backup settings. + * + */ +class DatabaseBackupSetting { + /** + * Create a DatabaseBackupSetting. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of DatabaseBackupSetting + * + * @returns {object} metadata of DatabaseBackupSetting + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseBackupSetting', + type: { + name: 'Composite', + className: 'DatabaseBackupSetting', + modelProperties: { + databaseType: { + required: true, + serializedName: 'databaseType', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + connectionStringName: { + required: false, + serializedName: 'connectionStringName', + type: { + name: 'String' + } + }, + connectionString: { + required: false, + serializedName: 'connectionString', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DatabaseBackupSetting; diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponse.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponse.js new file mode 100644 index 0000000000..5a7ecbca5a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponse.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * App Service error response. + * + */ +class DefaultErrorResponse { + /** + * Create a DefaultErrorResponse. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of DefaultErrorResponse + * + * @returns {object} metadata of DefaultErrorResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'DefaultErrorResponse', + type: { + name: 'Composite', + className: 'DefaultErrorResponse', + modelProperties: { + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'DefaultErrorResponseError' + } + } + } + } + }; + } +} + +module.exports = DefaultErrorResponse; diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js new file mode 100644 index 0000000000..53e7b42b06 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.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'; + +/** + * Error model. + * + */ +class DefaultErrorResponseError { + /** + * Create a DefaultErrorResponseError. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of DefaultErrorResponseError + * + * @returns {object} metadata of DefaultErrorResponseError + * + */ + mapper() { + return { + required: false, + serializedName: 'DefaultErrorResponse_error', + type: { + name: 'Composite', + className: 'DefaultErrorResponseError', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + target: { + required: false, + readOnly: true, + serializedName: 'target', + type: { + name: 'String' + } + }, + details: { + required: false, + serializedName: 'details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DefaultErrorResponseErrorDetailsItemElementType', + type: { + name: 'Composite', + className: 'DefaultErrorResponseErrorDetailsItem' + } + } + } + }, + innererror: { + required: false, + readOnly: true, + serializedName: 'innererror', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DefaultErrorResponseError; diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js new file mode 100644 index 0000000000..5462c48e7a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.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'; + +/** + * Detailed errors. + * + */ +class DefaultErrorResponseErrorDetailsItem { + /** + * Create a DefaultErrorResponseErrorDetailsItem. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of DefaultErrorResponseErrorDetailsItem + * + * @returns {object} metadata of DefaultErrorResponseErrorDetailsItem + * + */ + mapper() { + return { + required: false, + serializedName: 'DefaultErrorResponse_error_detailsItem', + type: { + name: 'Composite', + className: 'DefaultErrorResponseErrorDetailsItem', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + target: { + required: false, + readOnly: true, + serializedName: 'target', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DefaultErrorResponseErrorDetailsItem; diff --git a/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js b/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js new file mode 100644 index 0000000000..715d8d3e51 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.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'; + +const models = require('./index'); + +/** + * Details about restoring a deleted app. + * + * @extends models['ProxyOnlyResource'] + */ +class DeletedAppRestoreRequest extends models['ProxyOnlyResource'] { + /** + * Create a DeletedAppRestoreRequest. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedAppRestoreRequest + * + * @returns {object} metadata of DeletedAppRestoreRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedAppRestoreRequest', + type: { + name: 'Composite', + className: 'DeletedAppRestoreRequest', + 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, + serializedName: 'properties.deletedSiteId', + type: { + name: 'String' + } + }, + recoverConfiguration: { + required: false, + serializedName: 'properties.recoverConfiguration', + type: { + name: 'Boolean' + } + }, + snapshotTime: { + required: false, + serializedName: 'properties.snapshotTime', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedAppRestoreRequest; 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/deletedWebAppCollection.js b/lib/services/websiteManagement2/lib/models/deletedWebAppCollection.js new file mode 100644 index 0000000000..e4e74927f6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deletedWebAppCollection.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 deleted apps. + */ +class DeletedWebAppCollection extends Array { + /** + * Create a DeletedWebAppCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedWebAppCollection + * + * @returns {object} metadata of DeletedWebAppCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedWebAppCollection', + type: { + name: 'Composite', + className: 'DeletedWebAppCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeletedSiteElementType', + type: { + name: 'Composite', + className: 'DeletedSite' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedWebAppCollection; 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/deploymentCollection.js b/lib/services/websiteManagement2/lib/models/deploymentCollection.js new file mode 100644 index 0000000000..a8428276d9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deploymentCollection.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 deployments. + */ +class DeploymentCollection extends Array { + /** + * Create a DeploymentCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeploymentCollection + * + * @returns {object} metadata of DeploymentCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'DeploymentCollection', + type: { + name: 'Composite', + className: 'DeploymentCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeploymentElementType', + type: { + name: 'Composite', + className: 'Deployment' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeploymentCollection; diff --git a/lib/services/websiteManagement2/lib/models/deploymentLocations.js b/lib/services/websiteManagement2/lib/models/deploymentLocations.js new file mode 100644 index 0000000000..04d37df313 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deploymentLocations.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'; + +/** + * List of available locations (regions or App Service Environments) for + * deployment of App Service resources. + * + */ +class DeploymentLocations { + /** + * Create a DeploymentLocations. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of DeploymentLocations + * + * @returns {object} metadata of DeploymentLocations + * + */ + mapper() { + return { + required: false, + serializedName: 'DeploymentLocations', + type: { + name: 'Composite', + className: 'DeploymentLocations', + modelProperties: { + locations: { + required: false, + serializedName: 'locations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GeoRegionElementType', + type: { + name: 'Composite', + className: 'GeoRegion' + } + } + } + }, + hostingEnvironments: { + required: false, + serializedName: 'hostingEnvironments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AppServiceEnvironmentElementType', + type: { + name: 'Composite', + className: 'AppServiceEnvironment' + } + } + } + }, + hostingEnvironmentDeploymentInfos: { + required: false, + serializedName: 'hostingEnvironmentDeploymentInfos', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HostingEnvironmentDeploymentInfoElementType', + type: { + name: 'Composite', + className: 'HostingEnvironmentDeploymentInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = DeploymentLocations; diff --git a/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js b/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js new file mode 100644 index 0000000000..2080fbf6f4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.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'; + +/** + * Class representing Abnormal Time Period detected. + * + */ +class DetectorAbnormalTimePeriod { + /** + * Create a DetectorAbnormalTimePeriod. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of DetectorAbnormalTimePeriod + * + * @returns {object} metadata of DetectorAbnormalTimePeriod + * + */ + mapper() { + return { + required: false, + serializedName: 'DetectorAbnormalTimePeriod', + type: { + name: 'Composite', + className: 'DetectorAbnormalTimePeriod', + modelProperties: { + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + source: { + required: false, + serializedName: 'source', + type: { + name: 'String' + } + }, + priority: { + required: false, + serializedName: 'priority', + type: { + name: 'Number' + } + }, + metaData: { + required: false, + serializedName: 'metaData', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + } + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'ServiceIncident', 'AppDeployment', 'AppCrash', 'RuntimeIssueDetected', 'AseDeployment', 'UserIssue', 'PlatformIssue', 'Other' ] + } + }, + solutions: { + required: false, + serializedName: 'solutions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SolutionElementType', + type: { + name: 'Composite', + className: 'Solution' + } + } + } + } + } + } + }; + } +} + +module.exports = DetectorAbnormalTimePeriod; diff --git a/lib/services/websiteManagement2/lib/models/detectorDefinition.js b/lib/services/websiteManagement2/lib/models/detectorDefinition.js new file mode 100644 index 0000000000..0c4aa92814 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/detectorDefinition.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing detector definition + * + * @extends models['ProxyOnlyResource'] + */ +class DetectorDefinition extends models['ProxyOnlyResource'] { + /** + * Create a DetectorDefinition. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DetectorDefinition + * + * @returns {object} metadata of DetectorDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'DetectorDefinition', + type: { + name: 'Composite', + className: 'DetectorDefinition', + 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' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + rank: { + required: false, + readOnly: true, + serializedName: 'properties.rank', + type: { + name: 'Number' + } + }, + isEnabled: { + required: false, + readOnly: true, + serializedName: 'properties.isEnabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = DetectorDefinition; diff --git a/lib/services/websiteManagement2/lib/models/detectorInfo.js b/lib/services/websiteManagement2/lib/models/detectorInfo.js new file mode 100644 index 0000000000..7dc038b07c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/detectorInfo.js @@ -0,0 +1,81 @@ +/* + * 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'; + +/** + * Definition of Detector + * + */ +class DetectorInfo { + /** + * Create a DetectorInfo. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of DetectorInfo + * + * @returns {object} metadata of DetectorInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'DetectorInfo', + type: { + name: 'Composite', + className: 'DetectorInfo', + modelProperties: { + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + category: { + required: false, + readOnly: true, + serializedName: 'category', + type: { + name: 'String' + } + }, + subCategory: { + required: false, + readOnly: true, + serializedName: 'subCategory', + type: { + name: 'String' + } + }, + supportTopicId: { + required: false, + readOnly: true, + serializedName: 'supportTopicId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DetectorInfo; diff --git a/lib/services/websiteManagement2/lib/models/detectorResponse.js b/lib/services/websiteManagement2/lib/models/detectorResponse.js new file mode 100644 index 0000000000..6cfb11fcf6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/detectorResponse.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing Response from Detector + * + * @extends models['ProxyOnlyResource'] + */ +class DetectorResponse extends models['ProxyOnlyResource'] { + /** + * Create a DetectorResponse. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DetectorResponse + * + * @returns {object} metadata of DetectorResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'DetectorResponse', + type: { + name: 'Composite', + className: 'DetectorResponse', + 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' + } + }, + metadata: { + required: false, + serializedName: 'properties.metadata', + type: { + name: 'Composite', + className: 'DetectorInfo' + } + }, + dataset: { + required: false, + serializedName: 'properties.dataset', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiagnosticDataElementType', + type: { + name: 'Composite', + className: 'DiagnosticData' + } + } + } + } + } + } + }; + } +} + +module.exports = DetectorResponse; diff --git a/lib/services/websiteManagement2/lib/models/detectorResponseCollection.js b/lib/services/websiteManagement2/lib/models/detectorResponseCollection.js new file mode 100644 index 0000000000..4d168e407d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/detectorResponseCollection.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 detector responses + */ +class DetectorResponseCollection extends Array { + /** + * Create a DetectorResponseCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DetectorResponseCollection + * + * @returns {object} metadata of DetectorResponseCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'DetectorResponseCollection', + type: { + name: 'Composite', + className: 'DetectorResponseCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DetectorResponseElementType', + type: { + name: 'Composite', + className: 'DetectorResponse' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DetectorResponseCollection; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticAnalysis.js b/lib/services/websiteManagement2/lib/models/diagnosticAnalysis.js new file mode 100644 index 0000000000..350a897abb --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticAnalysis.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'); + +/** + * Class representing a diagnostic analysis done on an application + * + * @extends models['ProxyOnlyResource'] + */ +class DiagnosticAnalysis extends models['ProxyOnlyResource'] { + /** + * Create a DiagnosticAnalysis. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiagnosticAnalysis + * + * @returns {object} metadata of DiagnosticAnalysis + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticAnalysis', + type: { + name: 'Composite', + className: 'DiagnosticAnalysis', + 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' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + abnormalTimePeriods: { + required: false, + serializedName: 'properties.abnormalTimePeriods', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AbnormalTimePeriodElementType', + type: { + name: 'Composite', + className: 'AbnormalTimePeriod' + } + } + } + }, + payload: { + required: false, + serializedName: 'properties.payload', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AnalysisDataElementType', + type: { + name: 'Composite', + className: 'AnalysisData' + } + } + } + }, + nonCorrelatedDetectors: { + required: false, + serializedName: 'properties.nonCorrelatedDetectors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DetectorDefinitionElementType', + type: { + name: 'Composite', + className: 'DetectorDefinition' + } + } + } + } + } + } + }; + } +} + +module.exports = DiagnosticAnalysis; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticAnalysisCollection.js b/lib/services/websiteManagement2/lib/models/diagnosticAnalysisCollection.js new file mode 100644 index 0000000000..526e3d5542 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticAnalysisCollection.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 Diagnostic Analyses + */ +class DiagnosticAnalysisCollection extends Array { + /** + * Create a DiagnosticAnalysisCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiagnosticAnalysisCollection + * + * @returns {object} metadata of DiagnosticAnalysisCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticAnalysisCollection', + type: { + name: 'Composite', + className: 'DiagnosticAnalysisCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AnalysisDefinitionElementType', + type: { + name: 'Composite', + className: 'AnalysisDefinition' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiagnosticAnalysisCollection; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticCategory.js b/lib/services/websiteManagement2/lib/models/diagnosticCategory.js new file mode 100644 index 0000000000..f36e3076cc --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticCategory.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'); + +/** + * Class representing detector definition + * + * @extends models['ProxyOnlyResource'] + */ +class DiagnosticCategory extends models['ProxyOnlyResource'] { + /** + * Create a DiagnosticCategory. + * @member {string} [description] Description of the diagnostic category + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiagnosticCategory + * + * @returns {object} metadata of DiagnosticCategory + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticCategory', + type: { + name: 'Composite', + className: 'DiagnosticCategory', + 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' + } + } + } + } + }; + } +} + +module.exports = DiagnosticCategory; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticCategoryCollection.js b/lib/services/websiteManagement2/lib/models/diagnosticCategoryCollection.js new file mode 100644 index 0000000000..fc20ff19c1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticCategoryCollection.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 Diagnostic Categories + */ +class DiagnosticCategoryCollection extends Array { + /** + * Create a DiagnosticCategoryCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiagnosticCategoryCollection + * + * @returns {object} metadata of DiagnosticCategoryCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticCategoryCollection', + type: { + name: 'Composite', + className: 'DiagnosticCategoryCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiagnosticCategoryElementType', + type: { + name: 'Composite', + className: 'DiagnosticCategory' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiagnosticCategoryCollection; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticData.js b/lib/services/websiteManagement2/lib/models/diagnosticData.js new file mode 100644 index 0000000000..515871b8d6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticData.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Set of data with rendering instructions + * + */ +class DiagnosticData { + /** + * Create a DiagnosticData. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of DiagnosticData + * + * @returns {object} metadata of DiagnosticData + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticData', + type: { + name: 'Composite', + className: 'DiagnosticData', + modelProperties: { + table: { + required: false, + serializedName: 'table', + type: { + name: 'Composite', + className: 'DataTableResponseObject' + } + }, + renderingProperties: { + required: false, + serializedName: 'renderingProperties', + type: { + name: 'Composite', + className: 'Rendering' + } + } + } + } + }; + } +} + +module.exports = DiagnosticData; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticDetectorCollection.js b/lib/services/websiteManagement2/lib/models/diagnosticDetectorCollection.js new file mode 100644 index 0000000000..9b17e34ecb --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticDetectorCollection.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 Diagnostic Detectors + */ +class DiagnosticDetectorCollection extends Array { + /** + * Create a DiagnosticDetectorCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiagnosticDetectorCollection + * + * @returns {object} metadata of DiagnosticDetectorCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticDetectorCollection', + type: { + name: 'Composite', + className: 'DiagnosticDetectorCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DetectorDefinitionElementType', + type: { + name: 'Composite', + className: 'DetectorDefinition' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiagnosticDetectorCollection; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticDetectorResponse.js b/lib/services/websiteManagement2/lib/models/diagnosticDetectorResponse.js new file mode 100644 index 0000000000..880a1116cf --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticDetectorResponse.js @@ -0,0 +1,189 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing Reponse from Diagnostic Detectors + * + * @extends models['ProxyOnlyResource'] + */ +class DiagnosticDetectorResponse extends models['ProxyOnlyResource'] { + /** + * Create a DiagnosticDetectorResponse. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiagnosticDetectorResponse + * + * @returns {object} metadata of DiagnosticDetectorResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticDetectorResponse', + type: { + name: 'Composite', + className: 'DiagnosticDetectorResponse', + 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' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + issueDetected: { + required: false, + serializedName: 'properties.issueDetected', + type: { + name: 'Boolean' + } + }, + detectorDefinition: { + required: false, + serializedName: 'properties.detectorDefinition', + type: { + name: 'Composite', + className: 'DetectorDefinition' + } + }, + metrics: { + required: false, + serializedName: 'properties.metrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiagnosticMetricSetElementType', + type: { + name: 'Composite', + className: 'DiagnosticMetricSet' + } + } + } + }, + abnormalTimePeriods: { + required: false, + serializedName: 'properties.abnormalTimePeriods', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DetectorAbnormalTimePeriodElementType', + type: { + name: 'Composite', + className: 'DetectorAbnormalTimePeriod' + } + } + } + }, + data: { + required: false, + serializedName: 'properties.data', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + } + } + }, + responseMetaData: { + required: false, + serializedName: 'properties.responseMetaData', + type: { + name: 'Composite', + className: 'ResponseMetaData' + } + } + } + } + }; + } +} + +module.exports = DiagnosticDetectorResponse; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticMetricSample.js b/lib/services/websiteManagement2/lib/models/diagnosticMetricSample.js new file mode 100644 index 0000000000..334dc95c9f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticMetricSample.js @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing Diagnostic Metric + * + */ +class DiagnosticMetricSample { + /** + * Create a DiagnosticMetricSample. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of DiagnosticMetricSample + * + * @returns {object} metadata of DiagnosticMetricSample + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticMetricSample', + type: { + name: 'Composite', + className: 'DiagnosticMetricSample', + modelProperties: { + timestamp: { + required: false, + serializedName: 'timestamp', + type: { + name: 'DateTime' + } + }, + roleInstance: { + required: false, + serializedName: 'roleInstance', + type: { + name: 'String' + } + }, + total: { + required: false, + serializedName: 'total', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + serializedName: 'maximum', + type: { + name: 'Number' + } + }, + minimum: { + required: false, + serializedName: 'minimum', + type: { + name: 'Number' + } + }, + isAggregated: { + required: false, + serializedName: 'isAggregated', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = DiagnosticMetricSample; diff --git a/lib/services/websiteManagement2/lib/models/diagnosticMetricSet.js b/lib/services/websiteManagement2/lib/models/diagnosticMetricSet.js new file mode 100644 index 0000000000..f7cdef2b06 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticMetricSet.js @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing Diagnostic Metric information + * + */ +class DiagnosticMetricSet { + /** + * Create a DiagnosticMetricSet. + * @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} + */ + constructor() { + } + + /** + * Defines the metadata of DiagnosticMetricSet + * + * @returns {object} metadata of DiagnosticMetricSet + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticMetricSet', + type: { + name: 'Composite', + className: 'DiagnosticMetricSet', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + unit: { + required: false, + serializedName: 'unit', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + timeGrain: { + required: false, + serializedName: 'timeGrain', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiagnosticMetricSampleElementType', + type: { + name: 'Composite', + className: 'DiagnosticMetricSample' + } + } + } + } + } + } + }; + } +} + +module.exports = DiagnosticMetricSet; diff --git a/lib/services/websiteManagement2/lib/models/dimension.js b/lib/services/websiteManagement2/lib/models/dimension.js new file mode 100644 index 0000000000..53cbe470f0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/dimension.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * 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 + * + */ +class Dimension { + /** + * Create a Dimension. + * @member {string} [name] + * @member {string} [displayName] + * @member {string} [internalName] + * @member {boolean} [toBeExportedForShoebox] + */ + constructor() { + } + + /** + * Defines the metadata of Dimension + * + * @returns {object} metadata of Dimension + * + */ + mapper() { + return { + required: false, + serializedName: 'Dimension', + type: { + name: 'Composite', + className: 'Dimension', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + internalName: { + required: false, + serializedName: 'internalName', + type: { + name: 'String' + } + }, + toBeExportedForShoebox: { + required: false, + serializedName: 'toBeExportedForShoebox', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = Dimension; diff --git a/lib/services/websiteManagement2/lib/models/domain.js b/lib/services/websiteManagement2/lib/models/domain.js new file mode 100644 index 0000000000..8eed458789 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domain.js @@ -0,0 +1,414 @@ +/* + * 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'); + +/** + * Information about a domain. + * + * @extends models['Resource'] + */ +class Domain extends models['Resource'] { + /** + * Create 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] + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Domain + * + * @returns {object} metadata of Domain + * + */ + mapper() { + return { + required: false, + serializedName: 'Domain', + type: { + name: 'Composite', + className: 'Domain', + 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' + } + } + } + }, + contactAdmin: { + required: true, + serializedName: 'properties.contactAdmin', + type: { + name: 'Composite', + className: 'Contact' + } + }, + contactBilling: { + required: true, + serializedName: 'properties.contactBilling', + type: { + name: 'Composite', + className: 'Contact' + } + }, + contactRegistrant: { + required: true, + serializedName: 'properties.contactRegistrant', + type: { + name: 'Composite', + className: 'Contact' + } + }, + contactTech: { + required: true, + serializedName: 'properties.contactTech', + type: { + name: 'Composite', + className: 'Contact' + } + }, + registrationStatus: { + required: false, + readOnly: true, + serializedName: 'properties.registrationStatus', + type: { + name: 'Enum', + allowedValues: [ 'Active', 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' ] + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ] + } + }, + nameServers: { + required: false, + readOnly: true, + serializedName: 'properties.nameServers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + privacy: { + required: false, + serializedName: 'properties.privacy', + type: { + name: 'Boolean' + } + }, + createdTime: { + required: false, + readOnly: true, + serializedName: 'properties.createdTime', + type: { + name: 'DateTime' + } + }, + expirationTime: { + required: false, + readOnly: true, + serializedName: 'properties.expirationTime', + type: { + name: 'DateTime' + } + }, + lastRenewedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastRenewedTime', + type: { + name: 'DateTime' + } + }, + autoRenew: { + required: false, + serializedName: 'properties.autoRenew', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + readyForDnsRecordManagement: { + required: false, + readOnly: true, + serializedName: 'properties.readyForDnsRecordManagement', + type: { + name: 'Boolean' + } + }, + managedHostNames: { + required: false, + readOnly: true, + serializedName: 'properties.managedHostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HostNameElementType', + type: { + name: 'Composite', + className: 'HostName' + } + } + } + }, + consent: { + required: true, + serializedName: 'properties.consent', + type: { + name: 'Composite', + className: 'DomainPurchaseConsent' + } + }, + domainNotRenewableReasons: { + required: false, + readOnly: true, + serializedName: 'properties.domainNotRenewableReasons', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + dnsType: { + required: false, + serializedName: 'properties.dnsType', + type: { + name: 'Enum', + allowedValues: [ 'AzureDns', 'DefaultDomainRegistrarDns' ] + } + }, + dnsZoneId: { + required: false, + serializedName: 'properties.dnsZoneId', + type: { + name: 'String' + } + }, + targetDnsType: { + required: false, + serializedName: 'properties.targetDnsType', + type: { + name: 'Enum', + allowedValues: [ 'AzureDns', 'DefaultDomainRegistrarDns' ] + } + }, + authCode: { + required: false, + serializedName: 'properties.authCode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Domain; diff --git a/lib/services/websiteManagement2/lib/models/domainAvailablilityCheckResult.js b/lib/services/websiteManagement2/lib/models/domainAvailablilityCheckResult.js new file mode 100644 index 0000000000..545642c394 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domainAvailablilityCheckResult.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * Domain availablility check result. + * + */ +class DomainAvailablilityCheckResult { + /** + * Create a DomainAvailablilityCheckResult. + * @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' + */ + constructor() { + } + + /** + * Defines the metadata of DomainAvailablilityCheckResult + * + * @returns {object} metadata of DomainAvailablilityCheckResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DomainAvailablilityCheckResult', + type: { + name: 'Composite', + className: 'DomainAvailablilityCheckResult', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + available: { + required: false, + serializedName: 'available', + type: { + name: 'Boolean' + } + }, + domainType: { + required: false, + serializedName: 'domainType', + type: { + name: 'Enum', + allowedValues: [ 'Regular', 'SoftDeleted' ] + } + } + } + } + }; + } +} + +module.exports = DomainAvailablilityCheckResult; diff --git a/lib/services/websiteManagement2/lib/models/domainCollection.js b/lib/services/websiteManagement2/lib/models/domainCollection.js new file mode 100644 index 0000000000..bd23f8a9b7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domainCollection.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 domains. + */ +class DomainCollection extends Array { + /** + * Create a DomainCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DomainCollection + * + * @returns {object} metadata of DomainCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'DomainCollection', + type: { + name: 'Composite', + className: 'DomainCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DomainElementType', + type: { + name: 'Composite', + className: 'Domain' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DomainCollection; diff --git a/lib/services/websiteManagement2/lib/models/domainControlCenterSsoRequest.js b/lib/services/websiteManagement2/lib/models/domainControlCenterSsoRequest.js new file mode 100644 index 0000000000..c383cb4e4a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domainControlCenterSsoRequest.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Single sign-on request information for domain management. + * + */ +class DomainControlCenterSsoRequest { + /** + * Create a DomainControlCenterSsoRequest. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of DomainControlCenterSsoRequest + * + * @returns {object} metadata of DomainControlCenterSsoRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'DomainControlCenterSsoRequest', + type: { + name: 'Composite', + className: 'DomainControlCenterSsoRequest', + modelProperties: { + url: { + required: false, + readOnly: true, + serializedName: 'url', + type: { + name: 'String' + } + }, + postParameterKey: { + required: false, + readOnly: true, + serializedName: 'postParameterKey', + type: { + name: 'String' + } + }, + postParameterValue: { + required: false, + readOnly: true, + serializedName: 'postParameterValue', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DomainControlCenterSsoRequest; diff --git a/lib/services/websiteManagement2/lib/models/domainOwnershipIdentifier.js b/lib/services/websiteManagement2/lib/models/domainOwnershipIdentifier.js new file mode 100644 index 0000000000..357f342bab --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domainOwnershipIdentifier.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'; + +const models = require('./index'); + +/** + * Domain ownership Identifier. + * + * @extends models['ProxyOnlyResource'] + */ +class DomainOwnershipIdentifier extends models['ProxyOnlyResource'] { + /** + * Create a DomainOwnershipIdentifier. + * @member {string} [ownershipId] Ownership Id. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DomainOwnershipIdentifier + * + * @returns {object} metadata of DomainOwnershipIdentifier + * + */ + mapper() { + return { + required: false, + serializedName: 'DomainOwnershipIdentifier', + type: { + name: 'Composite', + className: 'DomainOwnershipIdentifier', + 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' + } + }, + ownershipId: { + required: false, + serializedName: 'properties.ownershipId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DomainOwnershipIdentifier; diff --git a/lib/services/websiteManagement2/lib/models/domainOwnershipIdentifierCollection.js b/lib/services/websiteManagement2/lib/models/domainOwnershipIdentifierCollection.js new file mode 100644 index 0000000000..a15ca8300a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domainOwnershipIdentifierCollection.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 domain ownership identifiers. + */ +class DomainOwnershipIdentifierCollection extends Array { + /** + * Create a DomainOwnershipIdentifierCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DomainOwnershipIdentifierCollection + * + * @returns {object} metadata of DomainOwnershipIdentifierCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'DomainOwnershipIdentifierCollection', + type: { + name: 'Composite', + className: 'DomainOwnershipIdentifierCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DomainOwnershipIdentifierElementType', + type: { + name: 'Composite', + className: 'DomainOwnershipIdentifier' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DomainOwnershipIdentifierCollection; diff --git a/lib/services/websiteManagement2/lib/models/domainPatchResource.js b/lib/services/websiteManagement2/lib/models/domainPatchResource.js new file mode 100644 index 0000000000..65093da110 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domainPatchResource.js @@ -0,0 +1,393 @@ +/* + * 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 domain. + * + * @extends models['ProxyOnlyResource'] + */ +class DomainPatchResource extends models['ProxyOnlyResource'] { + /** + * Create a DomainPatchResource. + * @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] + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DomainPatchResource + * + * @returns {object} metadata of DomainPatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'DomainPatchResource', + type: { + name: 'Composite', + className: 'DomainPatchResource', + 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' + } + }, + contactAdmin: { + required: true, + serializedName: 'properties.contactAdmin', + type: { + name: 'Composite', + className: 'Contact' + } + }, + contactBilling: { + required: true, + serializedName: 'properties.contactBilling', + type: { + name: 'Composite', + className: 'Contact' + } + }, + contactRegistrant: { + required: true, + serializedName: 'properties.contactRegistrant', + type: { + name: 'Composite', + className: 'Contact' + } + }, + contactTech: { + required: true, + serializedName: 'properties.contactTech', + type: { + name: 'Composite', + className: 'Contact' + } + }, + registrationStatus: { + required: false, + readOnly: true, + serializedName: 'properties.registrationStatus', + type: { + name: 'Enum', + allowedValues: [ 'Active', 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' ] + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ] + } + }, + nameServers: { + required: false, + readOnly: true, + serializedName: 'properties.nameServers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + privacy: { + required: false, + serializedName: 'properties.privacy', + type: { + name: 'Boolean' + } + }, + createdTime: { + required: false, + readOnly: true, + serializedName: 'properties.createdTime', + type: { + name: 'DateTime' + } + }, + expirationTime: { + required: false, + readOnly: true, + serializedName: 'properties.expirationTime', + type: { + name: 'DateTime' + } + }, + lastRenewedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastRenewedTime', + type: { + name: 'DateTime' + } + }, + autoRenew: { + required: false, + serializedName: 'properties.autoRenew', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + readyForDnsRecordManagement: { + required: false, + readOnly: true, + serializedName: 'properties.readyForDnsRecordManagement', + type: { + name: 'Boolean' + } + }, + managedHostNames: { + required: false, + readOnly: true, + serializedName: 'properties.managedHostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HostNameElementType', + type: { + name: 'Composite', + className: 'HostName' + } + } + } + }, + consent: { + required: true, + serializedName: 'properties.consent', + type: { + name: 'Composite', + className: 'DomainPurchaseConsent' + } + }, + domainNotRenewableReasons: { + required: false, + readOnly: true, + serializedName: 'properties.domainNotRenewableReasons', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + dnsType: { + required: false, + serializedName: 'properties.dnsType', + type: { + name: 'Enum', + allowedValues: [ 'AzureDns', 'DefaultDomainRegistrarDns' ] + } + }, + dnsZoneId: { + required: false, + serializedName: 'properties.dnsZoneId', + type: { + name: 'String' + } + }, + targetDnsType: { + required: false, + serializedName: 'properties.targetDnsType', + type: { + name: 'Enum', + allowedValues: [ 'AzureDns', 'DefaultDomainRegistrarDns' ] + } + }, + authCode: { + required: false, + serializedName: 'properties.authCode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DomainPatchResource; diff --git a/lib/services/websiteManagement2/lib/models/domainPurchaseConsent.js b/lib/services/websiteManagement2/lib/models/domainPurchaseConsent.js new file mode 100644 index 0000000000..9cd02ca121 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domainPurchaseConsent.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * Domain purchase consent object, representing acceptance of applicable legal + * agreements. + * + */ +class DomainPurchaseConsent { + /** + * Create a DomainPurchaseConsent. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of DomainPurchaseConsent + * + * @returns {object} metadata of DomainPurchaseConsent + * + */ + mapper() { + return { + required: false, + serializedName: 'DomainPurchaseConsent', + type: { + name: 'Composite', + className: 'DomainPurchaseConsent', + modelProperties: { + agreementKeys: { + required: false, + serializedName: 'agreementKeys', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + agreedBy: { + required: false, + serializedName: 'agreedBy', + type: { + name: 'String' + } + }, + agreedAt: { + required: false, + serializedName: 'agreedAt', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = DomainPurchaseConsent; diff --git a/lib/services/websiteManagement2/lib/models/domainRecommendationSearchParameters.js b/lib/services/websiteManagement2/lib/models/domainRecommendationSearchParameters.js new file mode 100644 index 0000000000..dd3a3b6af9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/domainRecommendationSearchParameters.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Domain recommendation search parameters. + * + */ +class DomainRecommendationSearchParameters { + /** + * Create a DomainRecommendationSearchParameters. + * @member {string} [keywords] Keywords to be used for generating domain + * recommendations. + * @member {number} [maxDomainRecommendations] Maximum number of + * recommendations. + */ + constructor() { + } + + /** + * Defines the metadata of DomainRecommendationSearchParameters + * + * @returns {object} metadata of DomainRecommendationSearchParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'DomainRecommendationSearchParameters', + type: { + name: 'Composite', + className: 'DomainRecommendationSearchParameters', + modelProperties: { + keywords: { + required: false, + serializedName: 'keywords', + type: { + name: 'String' + } + }, + maxDomainRecommendations: { + required: false, + serializedName: 'maxDomainRecommendations', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = DomainRecommendationSearchParameters; diff --git a/lib/services/websiteManagement2/lib/models/enabledConfig.js b/lib/services/websiteManagement2/lib/models/enabledConfig.js new file mode 100644 index 0000000000..b45f899d15 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/enabledConfig.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Enabled configuration. + * + */ +class EnabledConfig { + /** + * Create a EnabledConfig. + * @member {boolean} [enabled] True if configuration is enabled, false if it + * is disabled and null if configuration is not set. + */ + constructor() { + } + + /** + * Defines the metadata of EnabledConfig + * + * @returns {object} metadata of EnabledConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'EnabledConfig', + type: { + name: 'Composite', + className: 'EnabledConfig', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = EnabledConfig; diff --git a/lib/services/websiteManagement2/lib/models/errorEntity.js b/lib/services/websiteManagement2/lib/models/errorEntity.js new file mode 100644 index 0000000000..36492b145d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/errorEntity.js @@ -0,0 +1,107 @@ +/* + * 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'; + +/** + * Body of the error response returned from the API. + * + */ +class ErrorEntity { + /** + * Create a ErrorEntity. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorEntity + * + * @returns {object} metadata of ErrorEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorEntity', + type: { + name: 'Composite', + className: 'ErrorEntity', + modelProperties: { + extendedCode: { + required: false, + serializedName: 'extendedCode', + type: { + name: 'String' + } + }, + messageTemplate: { + required: false, + serializedName: 'messageTemplate', + type: { + name: 'String' + } + }, + parameters: { + required: false, + serializedName: 'parameters', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + innerErrors: { + required: false, + serializedName: 'innerErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ErrorEntityElementType', + type: { + name: 'Composite', + className: 'ErrorEntity' + } + } + } + }, + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorEntity; diff --git a/lib/services/websiteManagement2/lib/models/experiments.js b/lib/services/websiteManagement2/lib/models/experiments.js new file mode 100644 index 0000000000..3dd1828dcd --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/experiments.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Routing rules in production experiments. + * + */ +class Experiments { + /** + * Create a Experiments. + * @member {array} [rampUpRules] List of ramp-up rules. + */ + constructor() { + } + + /** + * Defines the metadata of Experiments + * + * @returns {object} metadata of Experiments + * + */ + mapper() { + return { + required: false, + serializedName: 'Experiments', + type: { + name: 'Composite', + className: 'Experiments', + modelProperties: { + rampUpRules: { + required: false, + serializedName: 'rampUpRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RampUpRuleElementType', + type: { + name: 'Composite', + className: 'RampUpRule' + } + } + } + } + } + } + }; + } +} + +module.exports = Experiments; diff --git a/lib/services/websiteManagement2/lib/models/fileSystemApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/models/fileSystemApplicationLogsConfig.js new file mode 100644 index 0000000000..b64d80772f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/fileSystemApplicationLogsConfig.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'; + +/** + * Application logs to file system configuration. + * + */ +class FileSystemApplicationLogsConfig { + /** + * Create a FileSystemApplicationLogsConfig. + * @member {string} [level] Log level. Possible values include: 'Off', + * 'Verbose', 'Information', 'Warning', 'Error'. Default value: 'Off' . + */ + constructor() { + } + + /** + * Defines the metadata of FileSystemApplicationLogsConfig + * + * @returns {object} metadata of FileSystemApplicationLogsConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'FileSystemApplicationLogsConfig', + type: { + name: 'Composite', + className: 'FileSystemApplicationLogsConfig', + modelProperties: { + level: { + required: false, + serializedName: 'level', + defaultValue: 'Off', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'Verbose', 'Information', 'Warning', 'Error' ] + } + } + } + } + }; + } +} + +module.exports = FileSystemApplicationLogsConfig; diff --git a/lib/services/websiteManagement2/lib/models/fileSystemHttpLogsConfig.js b/lib/services/websiteManagement2/lib/models/fileSystemHttpLogsConfig.js new file mode 100644 index 0000000000..e85d48eb3b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/fileSystemHttpLogsConfig.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * Http logs to file system configuration. + * + */ +class FileSystemHttpLogsConfig { + /** + * Create a FileSystemHttpLogsConfig. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of FileSystemHttpLogsConfig + * + * @returns {object} metadata of FileSystemHttpLogsConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'FileSystemHttpLogsConfig', + type: { + name: 'Composite', + className: 'FileSystemHttpLogsConfig', + modelProperties: { + retentionInMb: { + required: false, + serializedName: 'retentionInMb', + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 25 + }, + type: { + name: 'Number' + } + }, + retentionInDays: { + required: false, + serializedName: 'retentionInDays', + type: { + name: 'Number' + } + }, + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = FileSystemHttpLogsConfig; 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/functionEnvelopeCollection.js b/lib/services/websiteManagement2/lib/models/functionEnvelopeCollection.js new file mode 100644 index 0000000000..11a87f9e7b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/functionEnvelopeCollection.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 function information elements. + */ +class FunctionEnvelopeCollection extends Array { + /** + * Create a FunctionEnvelopeCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FunctionEnvelopeCollection + * + * @returns {object} metadata of FunctionEnvelopeCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'FunctionEnvelopeCollection', + type: { + name: 'Composite', + className: 'FunctionEnvelopeCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FunctionEnvelopeElementType', + type: { + name: 'Composite', + className: 'FunctionEnvelope' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FunctionEnvelopeCollection; 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/geoRegionCollection.js b/lib/services/websiteManagement2/lib/models/geoRegionCollection.js new file mode 100644 index 0000000000..b4383a4013 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/geoRegionCollection.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 geographical regions. + */ +class GeoRegionCollection extends Array { + /** + * Create a GeoRegionCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GeoRegionCollection + * + * @returns {object} metadata of GeoRegionCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'GeoRegionCollection', + type: { + name: 'Composite', + className: 'GeoRegionCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GeoRegionElementType', + type: { + name: 'Composite', + className: 'GeoRegion' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GeoRegionCollection; diff --git a/lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.js b/lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.js new file mode 100644 index 0000000000..a2c77faba9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.js @@ -0,0 +1,125 @@ +/* + * 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'; + +/** + * A Global SKU Description. + * + */ +class GlobalCsmSkuDescription { + /** + * Create a GlobalCsmSkuDescription. + * @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? + */ + constructor() { + } + + /** + * Defines the metadata of GlobalCsmSkuDescription + * + * @returns {object} metadata of GlobalCsmSkuDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'GlobalCsmSkuDescription', + type: { + name: 'Composite', + className: 'GlobalCsmSkuDescription', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + size: { + required: false, + serializedName: 'size', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Composite', + className: 'SkuCapacity' + } + }, + locations: { + required: false, + serializedName: 'locations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + capabilities: { + required: false, + serializedName: 'capabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CapabilityElementType', + type: { + name: 'Composite', + className: 'Capability' + } + } + } + } + } + } + }; + } +} + +module.exports = GlobalCsmSkuDescription; 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/hostName.js b/lib/services/websiteManagement2/lib/models/hostName.js new file mode 100644 index 0000000000..04e7ae98f7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hostName.js @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Details of a hostname derived from a domain. + * + */ +class HostName { + /** + * Create a HostName. + * @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' + */ + constructor() { + } + + /** + * Defines the metadata of HostName + * + * @returns {object} metadata of HostName + * + */ + mapper() { + return { + required: false, + serializedName: 'HostName', + type: { + name: 'Composite', + className: 'HostName', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + siteNames: { + required: false, + serializedName: 'siteNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + azureResourceName: { + required: false, + serializedName: 'azureResourceName', + type: { + name: 'String' + } + }, + azureResourceType: { + required: false, + serializedName: 'azureResourceType', + type: { + name: 'Enum', + allowedValues: [ 'Website', 'TrafficManager' ] + } + }, + customHostNameDnsRecordType: { + required: false, + serializedName: 'customHostNameDnsRecordType', + type: { + name: 'Enum', + allowedValues: [ 'CName', 'A' ] + } + }, + hostNameType: { + required: false, + serializedName: 'hostNameType', + type: { + name: 'Enum', + allowedValues: [ 'Verified', 'Managed' ] + } + } + } + } + }; + } +} + +module.exports = HostName; diff --git a/lib/services/websiteManagement2/lib/models/hostNameBinding.js b/lib/services/websiteManagement2/lib/models/hostNameBinding.js new file mode 100644 index 0000000000..f18fcbe373 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hostNameBinding.js @@ -0,0 +1,161 @@ +/* + * 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 hostname binding object. + * + * @extends models['ProxyOnlyResource'] + */ +class HostNameBinding extends models['ProxyOnlyResource'] { + /** + * Create a HostNameBinding. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HostNameBinding + * + * @returns {object} metadata of HostNameBinding + * + */ + mapper() { + return { + required: false, + serializedName: 'HostNameBinding', + type: { + name: 'Composite', + className: 'HostNameBinding', + 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' + } + }, + siteName: { + required: false, + serializedName: 'properties.siteName', + type: { + name: 'String' + } + }, + domainId: { + required: false, + serializedName: 'properties.domainId', + type: { + name: 'String' + } + }, + azureResourceName: { + required: false, + serializedName: 'properties.azureResourceName', + type: { + name: 'String' + } + }, + azureResourceType: { + required: false, + serializedName: 'properties.azureResourceType', + type: { + name: 'Enum', + allowedValues: [ 'Website', 'TrafficManager' ] + } + }, + customHostNameDnsRecordType: { + required: false, + serializedName: 'properties.customHostNameDnsRecordType', + type: { + name: 'Enum', + allowedValues: [ 'CName', 'A' ] + } + }, + hostNameType: { + required: false, + serializedName: 'properties.hostNameType', + type: { + name: 'Enum', + allowedValues: [ 'Verified', 'Managed' ] + } + }, + sslState: { + required: false, + serializedName: 'properties.sslState', + type: { + name: 'Enum', + allowedValues: [ 'Disabled', 'SniEnabled', 'IpBasedEnabled' ] + } + }, + thumbprint: { + required: false, + serializedName: 'properties.thumbprint', + type: { + name: 'String' + } + }, + virtualIP: { + required: false, + readOnly: true, + serializedName: 'properties.virtualIP', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HostNameBinding; diff --git a/lib/services/websiteManagement2/lib/models/hostNameBindingCollection.js b/lib/services/websiteManagement2/lib/models/hostNameBindingCollection.js new file mode 100644 index 0000000000..701310c452 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hostNameBindingCollection.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 hostname bindings. + */ +class HostNameBindingCollection extends Array { + /** + * Create a HostNameBindingCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HostNameBindingCollection + * + * @returns {object} metadata of HostNameBindingCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'HostNameBindingCollection', + type: { + name: 'Composite', + className: 'HostNameBindingCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HostNameBindingElementType', + type: { + name: 'Composite', + className: 'HostNameBinding' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HostNameBindingCollection; diff --git a/lib/services/websiteManagement2/lib/models/hostNameSslState.js b/lib/services/websiteManagement2/lib/models/hostNameSslState.js new file mode 100644 index 0000000000..2158c960f7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hostNameSslState.js @@ -0,0 +1,98 @@ +/* + * 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'; + +/** + * SSL-enabled hostname. + * + */ +class HostNameSslState { + /** + * Create a HostNameSslState. + * @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' + */ + constructor() { + } + + /** + * Defines the metadata of HostNameSslState + * + * @returns {object} metadata of HostNameSslState + * + */ + mapper() { + return { + required: false, + serializedName: 'HostNameSslState', + type: { + name: 'Composite', + className: 'HostNameSslState', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + sslState: { + required: false, + serializedName: 'sslState', + type: { + name: 'Enum', + allowedValues: [ 'Disabled', 'SniEnabled', 'IpBasedEnabled' ] + } + }, + virtualIP: { + required: false, + serializedName: 'virtualIP', + type: { + name: 'String' + } + }, + thumbprint: { + required: false, + serializedName: 'thumbprint', + type: { + name: 'String' + } + }, + toUpdate: { + required: false, + serializedName: 'toUpdate', + type: { + name: 'Boolean' + } + }, + hostType: { + required: false, + serializedName: 'hostType', + type: { + name: 'Enum', + allowedValues: [ 'Standard', 'Repository' ] + } + } + } + } + }; + } +} + +module.exports = HostNameSslState; diff --git a/lib/services/websiteManagement2/lib/models/hostingEnvironmentDeploymentInfo.js b/lib/services/websiteManagement2/lib/models/hostingEnvironmentDeploymentInfo.js new file mode 100644 index 0000000000..08dd21c8d2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hostingEnvironmentDeploymentInfo.js @@ -0,0 +1,60 @@ +/* + * 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 to create resources on an App Service Environment. + * + */ +class HostingEnvironmentDeploymentInfo { + /** + * Create a HostingEnvironmentDeploymentInfo. + * @member {string} [name] Name of the App Service Environment. + * @member {string} [location] Location of the App Service Environment. + */ + constructor() { + } + + /** + * Defines the metadata of HostingEnvironmentDeploymentInfo + * + * @returns {object} metadata of HostingEnvironmentDeploymentInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'HostingEnvironmentDeploymentInfo', + type: { + name: 'Composite', + className: 'HostingEnvironmentDeploymentInfo', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HostingEnvironmentDeploymentInfo; diff --git a/lib/services/websiteManagement2/lib/models/hostingEnvironmentDiagnostics.js b/lib/services/websiteManagement2/lib/models/hostingEnvironmentDiagnostics.js new file mode 100644 index 0000000000..2ea639d385 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hostingEnvironmentDiagnostics.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Diagnostics for an App Service Environment. + * + */ +class HostingEnvironmentDiagnostics { + /** + * Create a HostingEnvironmentDiagnostics. + * @member {string} [name] Name/identifier of the diagnostics. + * @member {string} [diagnosicsOutput] Diagnostics output. + */ + constructor() { + } + + /** + * Defines the metadata of HostingEnvironmentDiagnostics + * + * @returns {object} metadata of HostingEnvironmentDiagnostics + * + */ + mapper() { + return { + required: false, + serializedName: 'HostingEnvironmentDiagnostics', + type: { + name: 'Composite', + className: 'HostingEnvironmentDiagnostics', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + diagnosicsOutput: { + required: false, + serializedName: 'diagnosicsOutput', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HostingEnvironmentDiagnostics; diff --git a/lib/services/websiteManagement2/lib/models/hostingEnvironmentProfile.js b/lib/services/websiteManagement2/lib/models/hostingEnvironmentProfile.js new file mode 100644 index 0000000000..e339a1cc17 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hostingEnvironmentProfile.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Specification for an App Service Environment to use for this resource. + * + */ +class HostingEnvironmentProfile { + /** + * Create a HostingEnvironmentProfile. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of HostingEnvironmentProfile + * + * @returns {object} metadata of HostingEnvironmentProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'HostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HostingEnvironmentProfile; diff --git a/lib/services/websiteManagement2/lib/models/httpLogsConfig.js b/lib/services/websiteManagement2/lib/models/httpLogsConfig.js new file mode 100644 index 0000000000..36309201ef --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/httpLogsConfig.js @@ -0,0 +1,79 @@ +/* + * 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'; + +/** + * Http logs configuration. + * + */ +class HttpLogsConfig { + /** + * Create a HttpLogsConfig. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of HttpLogsConfig + * + * @returns {object} metadata of HttpLogsConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'HttpLogsConfig', + type: { + name: 'Composite', + className: 'HttpLogsConfig', + modelProperties: { + fileSystem: { + required: false, + serializedName: 'fileSystem', + type: { + name: 'Composite', + className: 'FileSystemHttpLogsConfig' + } + }, + azureBlobStorage: { + required: false, + serializedName: 'azureBlobStorage', + type: { + name: 'Composite', + className: 'AzureBlobStorageHttpLogsConfig' + } + } + } + } + }; + } +} + +module.exports = HttpLogsConfig; diff --git a/lib/services/websiteManagement2/lib/models/hybridConnection.js b/lib/services/websiteManagement2/lib/models/hybridConnection.js new file mode 100644 index 0000000000..8c40a4b549 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hybridConnection.js @@ -0,0 +1,148 @@ +/* + * 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'); + +/** + * Hybrid Connection contract. This is used to configure a Hybrid Connection. + * + * @extends models['ProxyOnlyResource'] + */ +class HybridConnection extends models['ProxyOnlyResource'] { + /** + * Create a HybridConnection. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HybridConnection + * + * @returns {object} metadata of HybridConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'HybridConnection', + type: { + name: 'Composite', + className: 'HybridConnection', + 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' + } + }, + serviceBusNamespace: { + required: false, + serializedName: 'properties.serviceBusNamespace', + type: { + name: 'String' + } + }, + relayName: { + required: false, + serializedName: 'properties.relayName', + type: { + name: 'String' + } + }, + relayArmUri: { + required: false, + serializedName: 'properties.relayArmUri', + type: { + name: 'String' + } + }, + hostname: { + required: false, + serializedName: 'properties.hostname', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'properties.port', + type: { + name: 'Number' + } + }, + sendKeyName: { + required: false, + serializedName: 'properties.sendKeyName', + type: { + name: 'String' + } + }, + sendKeyValue: { + required: false, + serializedName: 'properties.sendKeyValue', + type: { + name: 'String' + } + }, + serviceBusSuffix: { + required: false, + serializedName: 'properties.serviceBusSuffix', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HybridConnection; diff --git a/lib/services/websiteManagement2/lib/models/hybridConnectionCollection.js b/lib/services/websiteManagement2/lib/models/hybridConnectionCollection.js new file mode 100644 index 0000000000..ae824224f0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hybridConnectionCollection.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 hostname bindings. + */ +class HybridConnectionCollection extends Array { + /** + * Create a HybridConnectionCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HybridConnectionCollection + * + * @returns {object} metadata of HybridConnectionCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'HybridConnectionCollection', + type: { + name: 'Composite', + className: 'HybridConnectionCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HybridConnectionElementType', + type: { + name: 'Composite', + className: 'HybridConnection' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HybridConnectionCollection; diff --git a/lib/services/websiteManagement2/lib/models/hybridConnectionKey.js b/lib/services/websiteManagement2/lib/models/hybridConnectionKey.js new file mode 100644 index 0000000000..1f4ee6efc7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hybridConnectionKey.js @@ -0,0 +1,98 @@ +/* + * 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'); + +/** + * Hybrid Connection key contract. This has the send key name and value for a + * Hybrid Connection. + * + * @extends models['ProxyOnlyResource'] + */ +class HybridConnectionKey extends models['ProxyOnlyResource'] { + /** + * Create a HybridConnectionKey. + * @member {string} [sendKeyName] The name of the send key. + * @member {string} [sendKeyValue] The value of the send key. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HybridConnectionKey + * + * @returns {object} metadata of HybridConnectionKey + * + */ + mapper() { + return { + required: false, + serializedName: 'HybridConnectionKey', + type: { + name: 'Composite', + className: 'HybridConnectionKey', + 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' + } + }, + sendKeyName: { + required: false, + readOnly: true, + serializedName: 'properties.sendKeyName', + type: { + name: 'String' + } + }, + sendKeyValue: { + required: false, + readOnly: true, + serializedName: 'properties.sendKeyValue', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HybridConnectionKey; diff --git a/lib/services/websiteManagement2/lib/models/hybridConnectionLimits.js b/lib/services/websiteManagement2/lib/models/hybridConnectionLimits.js new file mode 100644 index 0000000000..dcae3a5dc1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/hybridConnectionLimits.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'; + +const models = require('./index'); + +/** + * Hybrid Connection limits contract. This is used to return the plan limits of + * Hybrid Connections. + * + * @extends models['ProxyOnlyResource'] + */ +class HybridConnectionLimits extends models['ProxyOnlyResource'] { + /** + * Create a HybridConnectionLimits. + * @member {number} [current] The current number of Hybrid Connections. + * @member {number} [maximum] The maximum number of Hybrid Connections + * allowed. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of HybridConnectionLimits + * + * @returns {object} metadata of HybridConnectionLimits + * + */ + mapper() { + return { + required: false, + serializedName: 'HybridConnectionLimits', + type: { + name: 'Composite', + className: 'HybridConnectionLimits', + 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' + } + }, + current: { + required: false, + readOnly: true, + serializedName: 'properties.current', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + readOnly: true, + serializedName: 'properties.maximum', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = HybridConnectionLimits; diff --git a/lib/services/websiteManagement2/lib/models/identifier.js b/lib/services/websiteManagement2/lib/models/identifier.js new file mode 100644 index 0000000000..6f2bbdd90e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/identifier.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'; + +const models = require('./index'); + +/** + * A domain specific resource identifier. + * + * @extends models['ProxyOnlyResource'] + */ +class Identifier extends models['ProxyOnlyResource'] { + /** + * Create a Identifier. + * @member {string} [identifierId] String representation of the identity. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Identifier + * + * @returns {object} metadata of Identifier + * + */ + mapper() { + return { + required: false, + serializedName: 'Identifier', + type: { + name: 'Composite', + className: 'Identifier', + 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' + } + }, + identifierId: { + required: false, + serializedName: 'properties.id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Identifier; diff --git a/lib/services/websiteManagement2/lib/models/identifierCollection.js b/lib/services/websiteManagement2/lib/models/identifierCollection.js new file mode 100644 index 0000000000..849810dc14 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/identifierCollection.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 identifiers. + */ +class IdentifierCollection extends Array { + /** + * Create a IdentifierCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of IdentifierCollection + * + * @returns {object} metadata of IdentifierCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'IdentifierCollection', + type: { + name: 'Composite', + className: 'IdentifierCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IdentifierElementType', + type: { + name: 'Composite', + className: 'Identifier' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IdentifierCollection; 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..0e4d9b0de5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -0,0 +1,7626 @@ +/* + * 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} [maximumElasticWorkerCount] Maximum number of total workers + * allowed for this ElasticScaleEnabled App Service Plan + * @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; + maximumElasticWorkerCount?: number; + 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 NetworkTrace class. + * @constructor + * Network trace + * + * @member {string} [path] Local file path for the captured network trace file. + * @member {string} [status] Current status of the network trace operation, + * same as Operation.Status (InProgress/Succeeded/Failed). + * @member {string} [message] Detailed message of a network trace operation, + * e.g. error message in case of failure. + */ +export interface NetworkTrace { + path?: string; + status?: string; + message?: string; +} + +/** + * @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} [maximumElasticWorkerCount] Maximum number of total workers + * allowed for this ElasticScaleEnabled App Service Plan + * @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; + maximumElasticWorkerCount?: number; + 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..f3212fe94c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/index.js @@ -0,0 +1,293 @@ +/* + * 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.NetworkTrace = require('./networkTrace'); +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/localizableString.js b/lib/services/websiteManagement2/lib/models/localizableString.js new file mode 100644 index 0000000000..0f464c7fe5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/localizableString.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Localizable string object containing the name and a localized value. + * + */ +class LocalizableString { + /** + * Create a LocalizableString. + * @member {string} [value] Non-localized name. + * @member {string} [localizedValue] Localized name. + */ + constructor() { + } + + /** + * Defines the metadata of LocalizableString + * + * @returns {object} metadata of LocalizableString + * + */ + mapper() { + return { + required: false, + serializedName: 'LocalizableString', + type: { + name: 'Composite', + className: 'LocalizableString', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + }, + localizedValue: { + required: false, + serializedName: 'localizedValue', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LocalizableString; diff --git a/lib/services/websiteManagement2/lib/models/logSpecification.js b/lib/services/websiteManagement2/lib/models/logSpecification.js new file mode 100644 index 0000000000..afeeeca8e1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/logSpecification.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'; + +/** + * Log Definition of a single resource metric. + * + */ +class LogSpecification { + /** + * Create a LogSpecification. + * @member {string} [name] + * @member {string} [displayName] + * @member {string} [blobDuration] + */ + constructor() { + } + + /** + * Defines the metadata of LogSpecification + * + * @returns {object} metadata of LogSpecification + * + */ + mapper() { + return { + required: false, + serializedName: 'LogSpecification', + type: { + name: 'Composite', + className: 'LogSpecification', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + blobDuration: { + required: false, + serializedName: 'blobDuration', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LogSpecification; diff --git a/lib/services/websiteManagement2/lib/models/mSDeploy.js b/lib/services/websiteManagement2/lib/models/mSDeploy.js new file mode 100644 index 0000000000..89bfbd351f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/mSDeploy.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'); + +/** + * MSDeploy ARM PUT information + * + * @extends models['ProxyOnlyResource'] + */ +class MSDeploy extends models['ProxyOnlyResource'] { + /** + * Create a MSDeploy. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MSDeploy + * + * @returns {object} metadata of MSDeploy + * + */ + mapper() { + return { + required: false, + serializedName: 'MSDeploy', + type: { + name: 'Composite', + className: 'MSDeploy', + 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' + } + }, + packageUri: { + required: false, + serializedName: 'properties.packageUri', + type: { + name: 'String' + } + }, + connectionString: { + required: false, + serializedName: 'properties.connectionString', + type: { + name: 'String' + } + }, + dbType: { + required: false, + serializedName: 'properties.dbType', + type: { + name: 'String' + } + }, + setParametersXmlFileUri: { + required: false, + serializedName: 'properties.setParametersXmlFileUri', + type: { + name: 'String' + } + }, + setParameters: { + required: false, + serializedName: 'properties.setParameters', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + skipAppData: { + required: false, + serializedName: 'properties.skipAppData', + type: { + name: 'Boolean' + } + }, + appOffline: { + required: false, + serializedName: 'properties.appOffline', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MSDeploy; diff --git a/lib/services/websiteManagement2/lib/models/mSDeployLog.js b/lib/services/websiteManagement2/lib/models/mSDeployLog.js new file mode 100644 index 0000000000..c4128e119d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/mSDeployLog.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'); + +/** + * MSDeploy log + * + * @extends models['ProxyOnlyResource'] + */ +class MSDeployLog extends models['ProxyOnlyResource'] { + /** + * Create a MSDeployLog. + * @member {array} [entries] List of log entry messages + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MSDeployLog + * + * @returns {object} metadata of MSDeployLog + * + */ + mapper() { + return { + required: false, + serializedName: 'MSDeployLog', + type: { + name: 'Composite', + className: 'MSDeployLog', + 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' + } + }, + entries: { + required: false, + readOnly: true, + serializedName: 'properties.entries', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MSDeployLogEntryElementType', + type: { + name: 'Composite', + className: 'MSDeployLogEntry' + } + } + } + } + } + } + }; + } +} + +module.exports = MSDeployLog; diff --git a/lib/services/websiteManagement2/lib/models/mSDeployLogEntry.js b/lib/services/websiteManagement2/lib/models/mSDeployLogEntry.js new file mode 100644 index 0000000000..dca0c93378 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/mSDeployLogEntry.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * MSDeploy log entry + * + */ +class MSDeployLogEntry { + /** + * Create a MSDeployLogEntry. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of MSDeployLogEntry + * + * @returns {object} metadata of MSDeployLogEntry + * + */ + mapper() { + return { + required: false, + serializedName: 'MSDeployLogEntry', + type: { + name: 'Composite', + className: 'MSDeployLogEntry', + modelProperties: { + time: { + required: false, + readOnly: true, + serializedName: 'time', + type: { + name: 'DateTime' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'Message', 'Warning', 'Error' ] + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MSDeployLogEntry; diff --git a/lib/services/websiteManagement2/lib/models/mSDeployStatus.js b/lib/services/websiteManagement2/lib/models/mSDeployStatus.js new file mode 100644 index 0000000000..3fedbf49cf --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/mSDeployStatus.js @@ -0,0 +1,127 @@ +/* + * 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'); + +/** + * MSDeploy ARM response + * + * @extends models['ProxyOnlyResource'] + */ +class MSDeployStatus extends models['ProxyOnlyResource'] { + /** + * Create a MSDeployStatus. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MSDeployStatus + * + * @returns {object} metadata of MSDeployStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'MSDeployStatus', + type: { + name: 'Composite', + className: 'MSDeployStatus', + 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' + } + }, + deployer: { + required: false, + readOnly: true, + serializedName: 'properties.deployer', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'accepted', 'running', 'succeeded', 'failed', 'canceled' ] + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + complete: { + required: false, + readOnly: true, + serializedName: 'properties.complete', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MSDeployStatus; 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/metricAvailabilily.js b/lib/services/websiteManagement2/lib/models/metricAvailabilily.js new file mode 100644 index 0000000000..7957ab3882 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/metricAvailabilily.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Metric availability and retention. + * + */ +class MetricAvailabilily { + /** + * Create a MetricAvailabilily. + * @member {string} [timeGrain] Time grain. + * @member {string} [retention] Retention period for the current time grain. + */ + constructor() { + } + + /** + * Defines the metadata of MetricAvailabilily + * + * @returns {object} metadata of MetricAvailabilily + * + */ + mapper() { + return { + required: false, + serializedName: 'MetricAvailabilily', + type: { + name: 'Composite', + className: 'MetricAvailabilily', + modelProperties: { + timeGrain: { + required: false, + serializedName: 'timeGrain', + type: { + name: 'String' + } + }, + retention: { + required: false, + serializedName: 'retention', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MetricAvailabilily; diff --git a/lib/services/websiteManagement2/lib/models/metricAvailability.js b/lib/services/websiteManagement2/lib/models/metricAvailability.js new file mode 100644 index 0000000000..84a9285bd4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/metricAvailability.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Retention policy of a resource metric. + * + */ +class MetricAvailability { + /** + * Create a MetricAvailability. + * @member {string} [timeGrain] + * @member {string} [blobDuration] + */ + constructor() { + } + + /** + * Defines the metadata of MetricAvailability + * + * @returns {object} metadata of MetricAvailability + * + */ + mapper() { + return { + required: false, + serializedName: 'MetricAvailability', + type: { + name: 'Composite', + className: 'MetricAvailability', + modelProperties: { + timeGrain: { + required: false, + serializedName: 'timeGrain', + type: { + name: 'String' + } + }, + blobDuration: { + required: false, + serializedName: 'blobDuration', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MetricAvailability; 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 new file mode 100644 index 0000000000..354439107c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/metricSpecification.js @@ -0,0 +1,180 @@ +/* + * 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'; + +/** + * Definition of a single resource metric. + * + */ +class MetricSpecification { + /** + * Create a MetricSpecification. + * @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] + */ + constructor() { + } + + /** + * Defines the metadata of MetricSpecification + * + * @returns {object} metadata of MetricSpecification + * + */ + mapper() { + return { + required: false, + serializedName: 'MetricSpecification', + type: { + name: 'Composite', + className: 'MetricSpecification', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + displayDescription: { + required: false, + serializedName: 'displayDescription', + type: { + name: 'String' + } + }, + unit: { + required: false, + serializedName: 'unit', + type: { + name: 'String' + } + }, + aggregationType: { + required: false, + serializedName: 'aggregationType', + type: { + name: 'String' + } + }, + supportsInstanceLevelAggregation: { + required: false, + serializedName: 'supportsInstanceLevelAggregation', + type: { + name: 'Boolean' + } + }, + enableRegionalMdmAccount: { + required: false, + serializedName: 'enableRegionalMdmAccount', + type: { + name: 'Boolean' + } + }, + sourceMdmAccount: { + required: false, + serializedName: 'sourceMdmAccount', + type: { + name: 'String' + } + }, + sourceMdmNamespace: { + required: false, + serializedName: 'sourceMdmNamespace', + type: { + name: 'String' + } + }, + metricFilterPattern: { + required: false, + serializedName: 'metricFilterPattern', + type: { + name: 'String' + } + }, + fillGapWithZero: { + required: false, + serializedName: 'fillGapWithZero', + type: { + name: 'Boolean' + } + }, + isInternal: { + required: false, + serializedName: 'isInternal', + type: { + name: 'Boolean' + } + }, + dimensions: { + required: false, + serializedName: 'dimensions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DimensionElementType', + type: { + name: 'Composite', + className: 'Dimension' + } + } + } + }, + category: { + required: false, + serializedName: 'category', + type: { + name: 'String' + } + }, + availabilities: { + required: false, + serializedName: 'availabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MetricAvailabilityElementType', + type: { + name: 'Composite', + className: 'MetricAvailability' + } + } + } + } + } + } + }; + } +} + +module.exports = MetricSpecification; diff --git a/lib/services/websiteManagement2/lib/models/migrateMySqlRequest.js b/lib/services/websiteManagement2/lib/models/migrateMySqlRequest.js new file mode 100644 index 0000000000..3f5a50472d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/migrateMySqlRequest.js @@ -0,0 +1,98 @@ +/* + * 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'); + +/** + * MySQL migration request. + * + * @extends models['ProxyOnlyResource'] + */ +class MigrateMySqlRequest extends models['ProxyOnlyResource'] { + /** + * Create a MigrateMySqlRequest. + * @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' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMySqlRequest + * + * @returns {object} metadata of MigrateMySqlRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateMySqlRequest', + type: { + name: 'Composite', + className: 'MigrateMySqlRequest', + 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' + } + }, + connectionString: { + required: true, + serializedName: 'properties.connectionString', + type: { + name: 'String' + } + }, + migrationType: { + required: true, + serializedName: 'properties.migrationType', + type: { + name: 'Enum', + allowedValues: [ 'LocalToRemote', 'RemoteToLocal' ] + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlRequest; diff --git a/lib/services/websiteManagement2/lib/models/migrateMySqlStatus.js b/lib/services/websiteManagement2/lib/models/migrateMySqlStatus.js new file mode 100644 index 0000000000..614da5a007 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/migrateMySqlStatus.js @@ -0,0 +1,110 @@ +/* + * 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'); + +/** + * MySQL migration status. + * + * @extends models['ProxyOnlyResource'] + */ +class MigrateMySqlStatus extends models['ProxyOnlyResource'] { + /** + * Create a MigrateMySqlStatus. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMySqlStatus + * + * @returns {object} metadata of MigrateMySqlStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateMySqlStatus', + type: { + name: 'Composite', + className: 'MigrateMySqlStatus', + 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' + } + }, + migrationOperationStatus: { + required: false, + readOnly: true, + serializedName: 'properties.migrationOperationStatus', + type: { + name: 'Enum', + allowedValues: [ 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' ] + } + }, + operationId: { + required: false, + readOnly: true, + serializedName: 'properties.operationId', + type: { + name: 'String' + } + }, + localMySqlEnabled: { + required: false, + readOnly: true, + serializedName: 'properties.localMySqlEnabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlStatus; diff --git a/lib/services/websiteManagement2/lib/models/nameIdentifier.js b/lib/services/websiteManagement2/lib/models/nameIdentifier.js new file mode 100644 index 0000000000..2147dc71dc --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/nameIdentifier.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Identifies an object. + * + */ +class NameIdentifier { + /** + * Create a NameIdentifier. + * @member {string} [name] Name of the object. + */ + constructor() { + } + + /** + * Defines the metadata of NameIdentifier + * + * @returns {object} metadata of NameIdentifier + * + */ + mapper() { + return { + required: false, + serializedName: 'NameIdentifier', + type: { + name: 'Composite', + className: 'NameIdentifier', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NameIdentifier; diff --git a/lib/services/websiteManagement2/lib/models/nameIdentifierCollection.js b/lib/services/websiteManagement2/lib/models/nameIdentifierCollection.js new file mode 100644 index 0000000000..ea628630e0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/nameIdentifierCollection.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 domain name identifiers. + */ +class NameIdentifierCollection extends Array { + /** + * Create a NameIdentifierCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NameIdentifierCollection + * + * @returns {object} metadata of NameIdentifierCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'NameIdentifierCollection', + type: { + name: 'Composite', + className: 'NameIdentifierCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameIdentifierElementType', + type: { + name: 'Composite', + className: 'NameIdentifier' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NameIdentifierCollection; diff --git a/lib/services/websiteManagement2/lib/models/nameValuePair.js b/lib/services/websiteManagement2/lib/models/nameValuePair.js new file mode 100644 index 0000000000..5e3cdf77c2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/nameValuePair.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Name value pair. + * + */ +class NameValuePair { + /** + * Create a NameValuePair. + * @member {string} [name] Pair name. + * @member {string} [value] Pair value. + */ + constructor() { + } + + /** + * Defines the metadata of NameValuePair + * + * @returns {object} metadata of NameValuePair + * + */ + mapper() { + return { + required: false, + serializedName: 'NameValuePair', + type: { + name: 'Composite', + className: 'NameValuePair', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NameValuePair; diff --git a/lib/services/websiteManagement2/lib/models/networkAccessControlEntry.js b/lib/services/websiteManagement2/lib/models/networkAccessControlEntry.js new file mode 100644 index 0000000000..841e6205dd --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/networkAccessControlEntry.js @@ -0,0 +1,79 @@ +/* + * 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'; + +/** + * Network access control entry. + * + */ +class NetworkAccessControlEntry { + /** + * Create a NetworkAccessControlEntry. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkAccessControlEntry + * + * @returns {object} metadata of NetworkAccessControlEntry + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkAccessControlEntry', + type: { + name: 'Composite', + className: 'NetworkAccessControlEntry', + modelProperties: { + action: { + required: false, + serializedName: 'action', + type: { + name: 'Enum', + allowedValues: [ 'Permit', 'Deny' ] + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + order: { + required: false, + serializedName: 'order', + type: { + name: 'Number' + } + }, + remoteSubnet: { + required: false, + serializedName: 'remoteSubnet', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkAccessControlEntry; diff --git a/lib/services/websiteManagement2/lib/models/networkFeatures.js b/lib/services/websiteManagement2/lib/models/networkFeatures.js new file mode 100644 index 0000000000..8d3d2959a8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/networkFeatures.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'; + +const models = require('./index'); + +/** + * Full view of network features for an app (presently VNET integration and + * Hybrid Connections). + * + * @extends models['ProxyOnlyResource'] + */ +class NetworkFeatures extends models['ProxyOnlyResource'] { + /** + * Create a NetworkFeatures. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkFeatures + * + * @returns {object} metadata of NetworkFeatures + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkFeatures', + type: { + name: 'Composite', + className: 'NetworkFeatures', + 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' + } + }, + virtualNetworkName: { + required: false, + readOnly: true, + serializedName: 'properties.virtualNetworkName', + type: { + name: 'String' + } + }, + virtualNetworkConnection: { + required: false, + readOnly: true, + serializedName: 'properties.virtualNetworkConnection', + type: { + name: 'Composite', + className: 'VnetInfo' + } + }, + hybridConnections: { + required: false, + readOnly: true, + serializedName: 'properties.hybridConnections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RelayServiceConnectionEntityElementType', + type: { + name: 'Composite', + className: 'RelayServiceConnectionEntity' + } + } + } + }, + hybridConnectionsV2: { + required: false, + readOnly: true, + serializedName: 'properties.hybridConnectionsV2', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HybridConnectionElementType', + type: { + name: 'Composite', + className: 'HybridConnection' + } + } + } + } + } + } + }; + } +} + +module.exports = NetworkFeatures; diff --git a/lib/services/websiteManagement2/lib/models/networkTrace.js b/lib/services/websiteManagement2/lib/models/networkTrace.js new file mode 100644 index 0000000000..ffd8d53400 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/networkTrace.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Network trace + * + */ +class NetworkTrace { + /** + * Create a NetworkTrace. + * @member {string} [path] Local file path for the captured network trace + * file. + * @member {string} [status] Current status of the network trace operation, + * same as Operation.Status (InProgress/Succeeded/Failed). + * @member {string} [message] Detailed message of a network trace operation, + * e.g. error message in case of failure. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkTrace + * + * @returns {object} metadata of NetworkTrace + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkTrace', + type: { + name: 'Composite', + className: 'NetworkTrace', + modelProperties: { + path: { + required: false, + serializedName: 'path', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkTrace; diff --git a/lib/services/websiteManagement2/lib/models/operation.js b/lib/services/websiteManagement2/lib/models/operation.js new file mode 100644 index 0000000000..a48c392107 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/operation.js @@ -0,0 +1,119 @@ +/* + * 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'; + +/** + * An operation on a resource. + * + */ +class Operation { + /** + * Create a Operation. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' ] + } + }, + errors: { + required: false, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ErrorEntityElementType', + type: { + name: 'Composite', + className: 'ErrorEntity' + } + } + } + }, + createdTime: { + required: false, + serializedName: 'createdTime', + type: { + name: 'DateTime' + } + }, + modifiedTime: { + required: false, + serializedName: 'modifiedTime', + type: { + name: 'DateTime' + } + }, + expirationTime: { + required: false, + serializedName: 'expirationTime', + type: { + name: 'DateTime' + } + }, + geoMasterOperationId: { + required: false, + serializedName: 'geoMasterOperationId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/websiteManagement2/lib/models/perfMonCounterCollection.js b/lib/services/websiteManagement2/lib/models/perfMonCounterCollection.js new file mode 100644 index 0000000000..f14a13dbff --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/perfMonCounterCollection.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 performance monitor counters. + */ +class PerfMonCounterCollection extends Array { + /** + * Create a PerfMonCounterCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PerfMonCounterCollection + * + * @returns {object} metadata of PerfMonCounterCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'PerfMonCounterCollection', + type: { + name: 'Composite', + className: 'PerfMonCounterCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PerfMonResponseElementType', + type: { + name: 'Composite', + className: 'PerfMonResponse' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PerfMonCounterCollection; diff --git a/lib/services/websiteManagement2/lib/models/perfMonResponse.js b/lib/services/websiteManagement2/lib/models/perfMonResponse.js new file mode 100644 index 0000000000..6eb5b04ffa --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/perfMonResponse.js @@ -0,0 +1,75 @@ +/* + * 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 API response. + * + */ +class PerfMonResponse { + /** + * Create a PerfMonResponse. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of PerfMonResponse + * + * @returns {object} metadata of PerfMonResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'PerfMonResponse', + type: { + name: 'Composite', + className: 'PerfMonResponse', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + data: { + required: false, + serializedName: 'data', + type: { + name: 'Composite', + className: 'PerfMonSet' + } + } + } + } + }; + } +} + +module.exports = PerfMonResponse; 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 new file mode 100644 index 0000000000..28beb00fd0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/perfMonSet.js @@ -0,0 +1,93 @@ +/* + * 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'; + +/** + * Metric information. + * + */ +class PerfMonSet { + /** + * Create a PerfMonSet. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of PerfMonSet + * + * @returns {object} metadata of PerfMonSet + * + */ + mapper() { + return { + required: false, + serializedName: 'PerfMonSet', + type: { + name: 'Composite', + className: 'PerfMonSet', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + timeGrain: { + required: false, + serializedName: 'timeGrain', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PerfMonSampleElementType', + type: { + name: 'Composite', + className: 'PerfMonSample' + } + } + } + } + } + } + }; + } +} + +module.exports = PerfMonSet; 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/premierAddOnOfferCollection.js b/lib/services/websiteManagement2/lib/models/premierAddOnOfferCollection.js new file mode 100644 index 0000000000..ceecaa63c2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/premierAddOnOfferCollection.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 premier add-on offers. + */ +class PremierAddOnOfferCollection extends Array { + /** + * Create a PremierAddOnOfferCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PremierAddOnOfferCollection + * + * @returns {object} metadata of PremierAddOnOfferCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'PremierAddOnOfferCollection', + type: { + name: 'Composite', + className: 'PremierAddOnOfferCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PremierAddOnOfferElementType', + type: { + name: 'Composite', + className: 'PremierAddOnOffer' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PremierAddOnOfferCollection; diff --git a/lib/services/websiteManagement2/lib/models/premierAddOnPatchResource.js b/lib/services/websiteManagement2/lib/models/premierAddOnPatchResource.js new file mode 100644 index 0000000000..9c9e00fe7f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/premierAddOnPatchResource.js @@ -0,0 +1,120 @@ +/* + * 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 PremierAddOn. + * + * @extends models['ProxyOnlyResource'] + */ +class PremierAddOnPatchResource extends models['ProxyOnlyResource'] { + /** + * Create a PremierAddOnPatchResource. + * @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 PremierAddOnPatchResource + * + * @returns {object} metadata of PremierAddOnPatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'PremierAddOnPatchResource', + type: { + name: 'Composite', + className: 'PremierAddOnPatchResource', + 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' + } + }, + marketplacePublisher: { + required: false, + serializedName: 'properties.marketplacePublisher', + type: { + name: 'String' + } + }, + marketplaceOffer: { + required: false, + serializedName: 'properties.marketplaceOffer', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PremierAddOnPatchResource; diff --git a/lib/services/websiteManagement2/lib/models/privateAccess.js b/lib/services/websiteManagement2/lib/models/privateAccess.js new file mode 100644 index 0000000000..b85b137319 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/privateAccess.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'); + +/** + * Description of the parameters of Private Access for a Web Site. + * + * @extends models['ProxyOnlyResource'] + */ +class PrivateAccess extends models['ProxyOnlyResource'] { + /** + * Create a PrivateAccess. + * @member {boolean} [enabled] Whether private access is enabled or not. + * @member {array} [virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PrivateAccess + * + * @returns {object} metadata of PrivateAccess + * + */ + mapper() { + return { + required: false, + serializedName: 'PrivateAccess', + type: { + name: 'Composite', + className: 'PrivateAccess', + 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' + } + }, + virtualNetworks: { + required: false, + serializedName: 'properties.virtualNetworks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrivateAccessVirtualNetworkElementType', + type: { + name: 'Composite', + className: 'PrivateAccessVirtualNetwork' + } + } + } + } + } + } + }; + } +} + +module.exports = PrivateAccess; diff --git a/lib/services/websiteManagement2/lib/models/privateAccessSubnet.js b/lib/services/websiteManagement2/lib/models/privateAccessSubnet.js new file mode 100644 index 0000000000..8390dc0093 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/privateAccessSubnet.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Description of a Virtual Network subnet that is useable for private site + * access. + * + */ +class PrivateAccessSubnet { + /** + * Create a PrivateAccessSubnet. + * @member {string} [name] The name of the subnet. + * @member {number} [key] The key (ID) of the subnet. + */ + constructor() { + } + + /** + * Defines the metadata of PrivateAccessSubnet + * + * @returns {object} metadata of PrivateAccessSubnet + * + */ + mapper() { + return { + required: false, + serializedName: 'PrivateAccessSubnet', + type: { + name: 'Composite', + className: 'PrivateAccessSubnet', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + key: { + required: false, + serializedName: 'key', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = PrivateAccessSubnet; diff --git a/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js b/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js new file mode 100644 index 0000000000..d3b7f3161f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js @@ -0,0 +1,86 @@ +/* + * 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 a Virtual Network that is useable for private site access. + * + */ +class PrivateAccessVirtualNetwork { + /** + * Create a PrivateAccessVirtualNetwork. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of PrivateAccessVirtualNetwork + * + * @returns {object} metadata of PrivateAccessVirtualNetwork + * + */ + mapper() { + return { + required: false, + serializedName: 'PrivateAccessVirtualNetwork', + type: { + name: 'Composite', + className: 'PrivateAccessVirtualNetwork', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + key: { + required: false, + serializedName: 'key', + type: { + name: 'Number' + } + }, + resourceId: { + required: false, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + subnets: { + required: false, + serializedName: 'subnets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrivateAccessSubnetElementType', + type: { + name: 'Composite', + className: 'PrivateAccessSubnet' + } + } + } + } + } + } + }; + } +} + +module.exports = PrivateAccessVirtualNetwork; 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/processInfoCollection.js b/lib/services/websiteManagement2/lib/models/processInfoCollection.js new file mode 100644 index 0000000000..7ebd35ee09 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/processInfoCollection.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 process information elements. + */ +class ProcessInfoCollection extends Array { + /** + * Create a ProcessInfoCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProcessInfoCollection + * + * @returns {object} metadata of ProcessInfoCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ProcessInfoCollection', + type: { + name: 'Composite', + className: 'ProcessInfoCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProcessInfoElementType', + type: { + name: 'Composite', + className: 'ProcessInfo' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessInfoCollection; 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/processModuleInfoCollection.js b/lib/services/websiteManagement2/lib/models/processModuleInfoCollection.js new file mode 100644 index 0000000000..3ce4dec596 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/processModuleInfoCollection.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 thread information elements. + */ +class ProcessModuleInfoCollection extends Array { + /** + * Create a ProcessModuleInfoCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProcessModuleInfoCollection + * + * @returns {object} metadata of ProcessModuleInfoCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ProcessModuleInfoCollection', + type: { + name: 'Composite', + className: 'ProcessModuleInfoCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProcessModuleInfoElementType', + type: { + name: 'Composite', + className: 'ProcessModuleInfo' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessModuleInfoCollection; 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/processThreadInfoCollection.js b/lib/services/websiteManagement2/lib/models/processThreadInfoCollection.js new file mode 100644 index 0000000000..5b6c63e1c9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/processThreadInfoCollection.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 thread information elements. + */ +class ProcessThreadInfoCollection extends Array { + /** + * Create a ProcessThreadInfoCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProcessThreadInfoCollection + * + * @returns {object} metadata of ProcessThreadInfoCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ProcessThreadInfoCollection', + type: { + name: 'Composite', + className: 'ProcessThreadInfoCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProcessThreadInfoElementType', + type: { + name: 'Composite', + className: 'ProcessThreadInfo' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessThreadInfoCollection; diff --git a/lib/services/websiteManagement2/lib/models/proxyOnlyResource.js b/lib/services/websiteManagement2/lib/models/proxyOnlyResource.js new file mode 100644 index 0000000000..ce25dbcdd7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/proxyOnlyResource.js @@ -0,0 +1,84 @@ +/* + * 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'); + +/** + * Azure proxy only resource. This resource is not tracked by Azure Resource + * Manager. + * + * @extends models['BaseResource'] + */ +class ProxyOnlyResource extends models['BaseResource'] { + /** + * Create a ProxyOnlyResource. + * @member {string} [id] Resource Id. + * @member {string} [name] Resource Name. + * @member {string} [kind] Kind of resource. + * @member {string} [type] Resource type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProxyOnlyResource + * + * @returns {object} metadata of ProxyOnlyResource + * + */ + mapper() { + return { + required: false, + serializedName: 'ProxyOnlyResource', + type: { + name: 'Composite', + className: 'ProxyOnlyResource', + 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' + } + } + } + } + }; + } +} + +module.exports = ProxyOnlyResource; diff --git a/lib/services/websiteManagement2/lib/models/publicCertificate.js b/lib/services/websiteManagement2/lib/models/publicCertificate.js new file mode 100644 index 0000000000..7d26d5e11a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/publicCertificate.js @@ -0,0 +1,106 @@ +/* + * 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'); + +/** + * Public certificate object + * + * @extends models['ProxyOnlyResource'] + */ +class PublicCertificate extends models['ProxyOnlyResource'] { + /** + * Create a PublicCertificate. + * @member {buffer} [blob] Public Certificate byte array + * @member {string} [publicCertificateLocation] Public Certificate Location. + * Possible values include: 'CurrentUserMy', 'LocalMachineMy', 'Unknown' + * @member {string} [thumbprint] Certificate Thumbprint + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PublicCertificate + * + * @returns {object} metadata of PublicCertificate + * + */ + mapper() { + return { + required: false, + serializedName: 'PublicCertificate', + type: { + name: 'Composite', + className: 'PublicCertificate', + 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' + } + }, + blob: { + required: false, + serializedName: 'properties.blob', + type: { + name: 'ByteArray' + } + }, + publicCertificateLocation: { + required: false, + serializedName: 'properties.publicCertificateLocation', + type: { + name: 'Enum', + allowedValues: [ 'CurrentUserMy', 'LocalMachineMy', 'Unknown' ] + } + }, + thumbprint: { + required: false, + readOnly: true, + serializedName: 'properties.thumbprint', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PublicCertificate; diff --git a/lib/services/websiteManagement2/lib/models/publicCertificateCollection.js b/lib/services/websiteManagement2/lib/models/publicCertificateCollection.js new file mode 100644 index 0000000000..39be88acc4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/publicCertificateCollection.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 public certificates + */ +class PublicCertificateCollection extends Array { + /** + * Create a PublicCertificateCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PublicCertificateCollection + * + * @returns {object} metadata of PublicCertificateCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'PublicCertificateCollection', + type: { + name: 'Composite', + className: 'PublicCertificateCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PublicCertificateElementType', + type: { + name: 'Composite', + className: 'PublicCertificate' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PublicCertificateCollection; diff --git a/lib/services/websiteManagement2/lib/models/pushSettings.js b/lib/services/websiteManagement2/lib/models/pushSettings.js new file mode 100644 index 0000000000..9c8bb1ec4e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/pushSettings.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'); + +/** + * Push settings for the App. + * + * @extends models['ProxyOnlyResource'] + */ +class PushSettings extends models['ProxyOnlyResource'] { + /** + * Create a PushSettings. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PushSettings + * + * @returns {object} metadata of PushSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'PushSettings', + type: { + name: 'Composite', + className: 'PushSettings', + 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' + } + }, + isPushEnabled: { + required: true, + serializedName: 'properties.isPushEnabled', + type: { + name: 'Boolean' + } + }, + tagWhitelistJson: { + required: false, + serializedName: 'properties.tagWhitelistJson', + type: { + name: 'String' + } + }, + tagsRequiringAuth: { + required: false, + serializedName: 'properties.tagsRequiringAuth', + type: { + name: 'String' + } + }, + dynamicTagsJson: { + required: false, + serializedName: 'properties.dynamicTagsJson', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PushSettings; diff --git a/lib/services/websiteManagement2/lib/models/rampUpRule.js b/lib/services/websiteManagement2/lib/models/rampUpRule.js new file mode 100644 index 0000000000..97701d5a8a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/rampUpRule.js @@ -0,0 +1,125 @@ +/* + * 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'; + +/** + * Routing rules for ramp up testing. This rule allows to redirect static + * traffic % to a slot or to gradually change routing % based on performance. + * + */ +class RampUpRule { + /** + * Create a RampUpRule. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of RampUpRule + * + * @returns {object} metadata of RampUpRule + * + */ + mapper() { + return { + required: false, + serializedName: 'RampUpRule', + type: { + name: 'Composite', + className: 'RampUpRule', + modelProperties: { + actionHostName: { + required: false, + serializedName: 'actionHostName', + type: { + name: 'String' + } + }, + reroutePercentage: { + required: false, + serializedName: 'reroutePercentage', + type: { + name: 'Number' + } + }, + changeStep: { + required: false, + serializedName: 'changeStep', + type: { + name: 'Number' + } + }, + changeIntervalInMinutes: { + required: false, + serializedName: 'changeIntervalInMinutes', + type: { + name: 'Number' + } + }, + minReroutePercentage: { + required: false, + serializedName: 'minReroutePercentage', + type: { + name: 'Number' + } + }, + maxReroutePercentage: { + required: false, + serializedName: 'maxReroutePercentage', + type: { + name: 'Number' + } + }, + changeDecisionCallbackUrl: { + required: false, + serializedName: 'changeDecisionCallbackUrl', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RampUpRule; 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/recommendationCollection.js b/lib/services/websiteManagement2/lib/models/recommendationCollection.js new file mode 100644 index 0000000000..e85014b66e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/recommendationCollection.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 recommendations. + */ +class RecommendationCollection extends Array { + /** + * Create a RecommendationCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RecommendationCollection + * + * @returns {object} metadata of RecommendationCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'RecommendationCollection', + type: { + name: 'Composite', + className: 'RecommendationCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RecommendationElementType', + type: { + name: 'Composite', + className: 'Recommendation' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RecommendationCollection; 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/reissueCertificateOrderRequest.js b/lib/services/websiteManagement2/lib/models/reissueCertificateOrderRequest.js new file mode 100644 index 0000000000..b7a796250c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/reissueCertificateOrderRequest.js @@ -0,0 +1,113 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing certificate reissue request. + * + * @extends models['ProxyOnlyResource'] + */ +class ReissueCertificateOrderRequest extends models['ProxyOnlyResource'] { + /** + * Create a ReissueCertificateOrderRequest. + * @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). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ReissueCertificateOrderRequest + * + * @returns {object} metadata of ReissueCertificateOrderRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'ReissueCertificateOrderRequest', + type: { + name: 'Composite', + className: 'ReissueCertificateOrderRequest', + 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' + } + }, + keySize: { + required: false, + serializedName: 'properties.keySize', + type: { + name: 'Number' + } + }, + delayExistingRevokeInHours: { + required: false, + serializedName: 'properties.delayExistingRevokeInHours', + type: { + name: 'Number' + } + }, + csr: { + required: false, + serializedName: 'properties.csr', + type: { + name: 'String' + } + }, + isPrivateKeyExternal: { + required: false, + serializedName: 'properties.isPrivateKeyExternal', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ReissueCertificateOrderRequest; diff --git a/lib/services/websiteManagement2/lib/models/relayServiceConnectionEntity.js b/lib/services/websiteManagement2/lib/models/relayServiceConnectionEntity.js new file mode 100644 index 0000000000..c54c71585a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/relayServiceConnectionEntity.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'; + +const models = require('./index'); + +/** + * Hybrid Connection for an App Service app. + * + * @extends models['ProxyOnlyResource'] + */ +class RelayServiceConnectionEntity extends models['ProxyOnlyResource'] { + /** + * Create a RelayServiceConnectionEntity. + * @member {string} [entityName] + * @member {string} [entityConnectionString] + * @member {string} [resourceType] + * @member {string} [resourceConnectionString] + * @member {string} [hostname] + * @member {number} [port] + * @member {string} [biztalkUri] + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RelayServiceConnectionEntity + * + * @returns {object} metadata of RelayServiceConnectionEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'RelayServiceConnectionEntity', + type: { + name: 'Composite', + className: 'RelayServiceConnectionEntity', + 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' + } + }, + entityName: { + required: false, + serializedName: 'properties.entityName', + type: { + name: 'String' + } + }, + entityConnectionString: { + required: false, + serializedName: 'properties.entityConnectionString', + type: { + name: 'String' + } + }, + resourceType: { + required: false, + serializedName: 'properties.resourceType', + type: { + name: 'String' + } + }, + resourceConnectionString: { + required: false, + serializedName: 'properties.resourceConnectionString', + type: { + name: 'String' + } + }, + hostname: { + required: false, + serializedName: 'properties.hostname', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'properties.port', + type: { + name: 'Number' + } + }, + biztalkUri: { + required: false, + serializedName: 'properties.biztalkUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RelayServiceConnectionEntity; diff --git a/lib/services/websiteManagement2/lib/models/rendering.js b/lib/services/websiteManagement2/lib/models/rendering.js new file mode 100644 index 0000000000..a2dd117840 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/rendering.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Instructions for rendering the data + * + */ +class Rendering { + /** + * Create a Rendering. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of Rendering + * + * @returns {object} metadata of Rendering + * + */ + mapper() { + return { + required: false, + serializedName: 'Rendering', + type: { + name: 'Composite', + className: 'Rendering', + modelProperties: { + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' ] + } + }, + title: { + required: false, + serializedName: 'title', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Rendering; diff --git a/lib/services/websiteManagement2/lib/models/renewCertificateOrderRequest.js b/lib/services/websiteManagement2/lib/models/renewCertificateOrderRequest.js new file mode 100644 index 0000000000..b72c6763f4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/renewCertificateOrderRequest.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'); + +/** + * Class representing certificate renew request. + * + * @extends models['ProxyOnlyResource'] + */ +class RenewCertificateOrderRequest extends models['ProxyOnlyResource'] { + /** + * Create a RenewCertificateOrderRequest. + * @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). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RenewCertificateOrderRequest + * + * @returns {object} metadata of RenewCertificateOrderRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'RenewCertificateOrderRequest', + type: { + name: 'Composite', + className: 'RenewCertificateOrderRequest', + 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' + } + }, + keySize: { + required: false, + serializedName: 'properties.keySize', + type: { + name: 'Number' + } + }, + csr: { + required: false, + serializedName: 'properties.csr', + type: { + name: 'String' + } + }, + isPrivateKeyExternal: { + required: false, + serializedName: 'properties.isPrivateKeyExternal', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = RenewCertificateOrderRequest; diff --git a/lib/services/websiteManagement2/lib/models/requestsBasedTrigger.js b/lib/services/websiteManagement2/lib/models/requestsBasedTrigger.js new file mode 100644 index 0000000000..60c548d329 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/requestsBasedTrigger.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Trigger based on total requests. + * + */ +class RequestsBasedTrigger { + /** + * Create a RequestsBasedTrigger. + * @member {number} [count] Request Count. + * @member {string} [timeInterval] Time interval. + */ + constructor() { + } + + /** + * Defines the metadata of RequestsBasedTrigger + * + * @returns {object} metadata of RequestsBasedTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'RequestsBasedTrigger', + type: { + name: 'Composite', + className: 'RequestsBasedTrigger', + modelProperties: { + count: { + required: false, + serializedName: 'count', + type: { + name: 'Number' + } + }, + timeInterval: { + required: false, + serializedName: 'timeInterval', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RequestsBasedTrigger; diff --git a/lib/services/websiteManagement2/lib/models/resource.js b/lib/services/websiteManagement2/lib/models/resource.js new file mode 100644 index 0000000000..ee72e3156a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resource.js @@ -0,0 +1,106 @@ +/* + * 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'); + +/** + * Azure resource. This resource is tracked in Azure Resource Manager + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + 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' + } + } + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/websiteManagement2/lib/models/resourceCollection.js b/lib/services/websiteManagement2/lib/models/resourceCollection.js new file mode 100644 index 0000000000..d49a0d8fec --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceCollection.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Collection of resources. + */ +class ResourceCollection extends Array { + /** + * Create a ResourceCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceCollection + * + * @returns {object} metadata of ResourceCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceCollection', + type: { + name: 'Composite', + className: 'ResourceCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceCollection; 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 new file mode 100644 index 0000000000..5ae05578bc --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetric.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'; + +/** + * Object representing a metric for any resource . + * + */ +class ResourceMetric { + /** + * Create a ResourceMetric. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceMetric + * + * @returns {object} metadata of ResourceMetric + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMetric', + type: { + name: 'Composite', + className: 'ResourceMetric', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'Composite', + className: 'ResourceMetricName' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'String' + } + }, + timeGrain: { + required: false, + readOnly: true, + serializedName: 'timeGrain', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + resourceId: { + required: false, + readOnly: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + metricValues: { + required: false, + readOnly: true, + serializedName: 'metricValues', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceMetricValueElementType', + type: { + name: 'Composite', + className: 'ResourceMetricValue' + } + } + } + }, + properties: { + required: false, + readOnly: true, + serializedName: 'properties', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceMetricPropertyElementType', + type: { + name: 'Composite', + className: 'ResourceMetricProperty' + } + } + } + } + } + } + }; + } +} + +module.exports = ResourceMetric; diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricAvailability.js b/lib/services/websiteManagement2/lib/models/resourceMetricAvailability.js new file mode 100644 index 0000000000..477e5bb26c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricAvailability.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Metrics availability and retention. + * + */ +class ResourceMetricAvailability { + /** + * Create a ResourceMetricAvailability. + * @member {string} [timeGrain] Time grain . + * @member {string} [retention] Retention period for the current time grain. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceMetricAvailability + * + * @returns {object} metadata of ResourceMetricAvailability + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMetricAvailability', + type: { + name: 'Composite', + className: 'ResourceMetricAvailability', + modelProperties: { + timeGrain: { + required: false, + readOnly: true, + serializedName: 'timeGrain', + type: { + name: 'String' + } + }, + retention: { + required: false, + readOnly: true, + serializedName: 'retention', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceMetricAvailability; diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricCollection.js b/lib/services/websiteManagement2/lib/models/resourceMetricCollection.js new file mode 100644 index 0000000000..579749b9a4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricCollection.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 metric responses. + */ +class ResourceMetricCollection extends Array { + /** + * Create a ResourceMetricCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceMetricCollection + * + * @returns {object} metadata of ResourceMetricCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMetricCollection', + type: { + name: 'Composite', + className: 'ResourceMetricCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceMetricElementType', + type: { + name: 'Composite', + className: 'ResourceMetric' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceMetricCollection; 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/resourceMetricDefinitionCollection.js b/lib/services/websiteManagement2/lib/models/resourceMetricDefinitionCollection.js new file mode 100644 index 0000000000..5de7ff20bf --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricDefinitionCollection.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 metric definitions. + */ +class ResourceMetricDefinitionCollection extends Array { + /** + * Create a ResourceMetricDefinitionCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceMetricDefinitionCollection + * + * @returns {object} metadata of ResourceMetricDefinitionCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMetricDefinitionCollection', + type: { + name: 'Composite', + className: 'ResourceMetricDefinitionCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceMetricDefinitionElementType', + type: { + name: 'Composite', + className: 'ResourceMetricDefinition' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceMetricDefinitionCollection; diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricName.js b/lib/services/websiteManagement2/lib/models/resourceMetricName.js new file mode 100644 index 0000000000..8aea96ba4a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricName.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Name of a metric for any resource . + * + */ +class ResourceMetricName { + /** + * Create a ResourceMetricName. + * @member {string} [value] metric name value. + * @member {string} [localizedValue] Localized metric name value. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceMetricName + * + * @returns {object} metadata of ResourceMetricName + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMetricName', + type: { + name: 'Composite', + className: 'ResourceMetricName', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + localizedValue: { + required: false, + readOnly: true, + serializedName: 'localizedValue', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceMetricName; diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricProperty.js b/lib/services/websiteManagement2/lib/models/resourceMetricProperty.js new file mode 100644 index 0000000000..e1c189544b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricProperty.js @@ -0,0 +1,60 @@ +/* + * 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 metric property. + * + */ +class ResourceMetricProperty { + /** + * Create a ResourceMetricProperty. + * @member {string} [key] Key for resource metric property. + * @member {string} [value] Value of pair. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceMetricProperty + * + * @returns {object} metadata of ResourceMetricProperty + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMetricProperty', + type: { + name: 'Composite', + className: 'ResourceMetricProperty', + modelProperties: { + key: { + required: false, + serializedName: 'key', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceMetricProperty; diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricValue.js b/lib/services/websiteManagement2/lib/models/resourceMetricValue.js new file mode 100644 index 0000000000..83e20dd398 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricValue.js @@ -0,0 +1,115 @@ +/* + * 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'; + +/** + * Value of resource metric. + * + */ +class ResourceMetricValue { + /** + * Create a ResourceMetricValue. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceMetricValue + * + * @returns {object} metadata of ResourceMetricValue + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMetricValue', + type: { + name: 'Composite', + className: 'ResourceMetricValue', + modelProperties: { + timestamp: { + required: false, + readOnly: true, + serializedName: 'timestamp', + type: { + name: 'String' + } + }, + average: { + required: false, + readOnly: true, + serializedName: 'average', + type: { + name: 'Number' + } + }, + minimum: { + required: false, + readOnly: true, + serializedName: 'minimum', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + readOnly: true, + serializedName: 'maximum', + type: { + name: 'Number' + } + }, + total: { + required: false, + readOnly: true, + serializedName: 'total', + type: { + name: 'Number' + } + }, + count: { + required: false, + readOnly: true, + serializedName: 'count', + type: { + name: 'Number' + } + }, + properties: { + required: false, + readOnly: true, + serializedName: 'properties', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceMetricPropertyElementType', + type: { + name: 'Composite', + className: 'ResourceMetricProperty' + } + } + } + } + } + } + }; + } +} + +module.exports = ResourceMetricValue; diff --git a/lib/services/websiteManagement2/lib/models/resourceNameAvailability.js b/lib/services/websiteManagement2/lib/models/resourceNameAvailability.js new file mode 100644 index 0000000000..a733bc7a1e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceNameAvailability.js @@ -0,0 +1,78 @@ +/* + * 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 regarding availbility of a resource name. + * + */ +class ResourceNameAvailability { + /** + * Create a ResourceNameAvailability. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceNameAvailability + * + * @returns {object} metadata of ResourceNameAvailability + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceNameAvailability', + type: { + name: 'Composite', + className: 'ResourceNameAvailability', + modelProperties: { + nameAvailable: { + required: false, + serializedName: 'nameAvailable', + type: { + name: 'Boolean' + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceNameAvailability; diff --git a/lib/services/websiteManagement2/lib/models/resourceNameAvailabilityRequest.js b/lib/services/websiteManagement2/lib/models/resourceNameAvailabilityRequest.js new file mode 100644 index 0000000000..fceb2c2a08 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceNameAvailabilityRequest.js @@ -0,0 +1,71 @@ +/* + * 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 name availability request content. + * + */ +class ResourceNameAvailabilityRequest { + /** + * Create a ResourceNameAvailabilityRequest. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceNameAvailabilityRequest + * + * @returns {object} metadata of ResourceNameAvailabilityRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceNameAvailabilityRequest', + type: { + name: 'Composite', + className: 'ResourceNameAvailabilityRequest', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + isFqdn: { + required: false, + serializedName: 'isFqdn', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ResourceNameAvailabilityRequest; diff --git a/lib/services/websiteManagement2/lib/models/responseMetaData.js b/lib/services/websiteManagement2/lib/models/responseMetaData.js new file mode 100644 index 0000000000..9215d9bd53 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/responseMetaData.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'; + +/** + * Class representing a ResponseMetaData. + */ +class ResponseMetaData { + /** + * Create a ResponseMetaData. + * @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 + */ + constructor() { + } + + /** + * Defines the metadata of ResponseMetaData + * + * @returns {object} metadata of ResponseMetaData + * + */ + mapper() { + return { + required: false, + serializedName: 'ResponseMetaData', + type: { + name: 'Composite', + className: 'ResponseMetaData', + modelProperties: { + dataSource: { + required: false, + serializedName: 'dataSource', + type: { + name: 'Composite', + className: 'DataSource' + } + } + } + } + }; + } +} + +module.exports = 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 new file mode 100644 index 0000000000..e006a4d2b2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteCloneability.js @@ -0,0 +1,106 @@ +/* + * 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'; + +/** + * Represents whether or not an app is cloneable. + * + */ +class SiteCloneability { + /** + * Create a SiteCloneability. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of SiteCloneability + * + * @returns {object} metadata of SiteCloneability + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteCloneability', + type: { + name: 'Composite', + className: 'SiteCloneability', + modelProperties: { + result: { + required: false, + serializedName: 'result', + type: { + name: 'Enum', + allowedValues: [ 'Cloneable', 'PartiallyCloneable', 'NotCloneable' ] + } + }, + blockingFeatures: { + required: false, + serializedName: 'blockingFeatures', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SiteCloneabilityCriterionElementType', + type: { + name: 'Composite', + className: 'SiteCloneabilityCriterion' + } + } + } + }, + unsupportedFeatures: { + required: false, + serializedName: 'unsupportedFeatures', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SiteCloneabilityCriterionElementType', + type: { + name: 'Composite', + className: 'SiteCloneabilityCriterion' + } + } + } + }, + blockingCharacteristics: { + required: false, + serializedName: 'blockingCharacteristics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SiteCloneabilityCriterionElementType', + type: { + name: 'Composite', + className: 'SiteCloneabilityCriterion' + } + } + } + } + } + } + }; + } +} + +module.exports = SiteCloneability; diff --git a/lib/services/websiteManagement2/lib/models/siteCloneabilityCriterion.js b/lib/services/websiteManagement2/lib/models/siteCloneabilityCriterion.js new file mode 100644 index 0000000000..7d5d208e54 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteCloneabilityCriterion.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * An app cloneability criterion. + * + */ +class SiteCloneabilityCriterion { + /** + * Create a SiteCloneabilityCriterion. + * @member {string} [name] Name of criterion. + * @member {string} [description] Description of criterion. + */ + constructor() { + } + + /** + * Defines the metadata of SiteCloneabilityCriterion + * + * @returns {object} metadata of SiteCloneabilityCriterion + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteCloneabilityCriterion', + type: { + name: 'Composite', + className: 'SiteCloneabilityCriterion', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteCloneabilityCriterion; 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/siteConfigResourceCollection.js b/lib/services/websiteManagement2/lib/models/siteConfigResourceCollection.js new file mode 100644 index 0000000000..e1668edee7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteConfigResourceCollection.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 site configurations. + */ +class SiteConfigResourceCollection extends Array { + /** + * Create a SiteConfigResourceCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteConfigResourceCollection + * + * @returns {object} metadata of SiteConfigResourceCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteConfigResourceCollection', + type: { + name: 'Composite', + className: 'SiteConfigResourceCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SiteConfigResourceElementType', + type: { + name: 'Composite', + className: 'SiteConfigResource' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteConfigResourceCollection; 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/siteConfigurationSnapshotInfoCollection.js b/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfoCollection.js new file mode 100644 index 0000000000..6bdb27ef62 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfoCollection.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'; + +/** + * Collection of metadata for the app configuration snapshots that can be + * restored. + */ +class SiteConfigurationSnapshotInfoCollection extends Array { + /** + * Create a SiteConfigurationSnapshotInfoCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteConfigurationSnapshotInfoCollection + * + * @returns {object} metadata of SiteConfigurationSnapshotInfoCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteConfigurationSnapshotInfoCollection', + type: { + name: 'Composite', + className: 'SiteConfigurationSnapshotInfoCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SiteConfigurationSnapshotInfoElementType', + type: { + name: 'Composite', + className: 'SiteConfigurationSnapshotInfo' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteConfigurationSnapshotInfoCollection; 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/siteExtensionInfoCollection.js b/lib/services/websiteManagement2/lib/models/siteExtensionInfoCollection.js new file mode 100644 index 0000000000..be20a01f06 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteExtensionInfoCollection.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 site extension information elements. + */ +class SiteExtensionInfoCollection extends Array { + /** + * Create a SiteExtensionInfoCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteExtensionInfoCollection + * + * @returns {object} metadata of SiteExtensionInfoCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteExtensionInfoCollection', + type: { + name: 'Composite', + className: 'SiteExtensionInfoCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SiteExtensionInfoElementType', + type: { + name: 'Composite', + className: 'SiteExtensionInfo' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteExtensionInfoCollection; 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/siteLimits.js b/lib/services/websiteManagement2/lib/models/siteLimits.js new file mode 100644 index 0000000000..48f8562cea --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteLimits.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'; + +/** + * Metric limits set on an app. + * + */ +class SiteLimits { + /** + * Create a SiteLimits. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of SiteLimits + * + * @returns {object} metadata of SiteLimits + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteLimits', + type: { + name: 'Composite', + className: 'SiteLimits', + modelProperties: { + maxPercentageCpu: { + required: false, + serializedName: 'maxPercentageCpu', + type: { + name: 'Number' + } + }, + maxMemoryInMb: { + required: false, + serializedName: 'maxMemoryInMb', + type: { + name: 'Number' + } + }, + maxDiskSizeInMb: { + required: false, + serializedName: 'maxDiskSizeInMb', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = SiteLimits; diff --git a/lib/services/websiteManagement2/lib/models/siteLogsConfig.js b/lib/services/websiteManagement2/lib/models/siteLogsConfig.js new file mode 100644 index 0000000000..04f1df34a8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteLogsConfig.js @@ -0,0 +1,165 @@ +/* + * 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 of App Service site logs. + * + * @extends models['ProxyOnlyResource'] + */ +class SiteLogsConfig extends models['ProxyOnlyResource'] { + /** + * Create a SiteLogsConfig. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteLogsConfig + * + * @returns {object} metadata of SiteLogsConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteLogsConfig', + type: { + name: 'Composite', + className: 'SiteLogsConfig', + 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' + } + }, + applicationLogs: { + required: false, + serializedName: 'properties.applicationLogs', + type: { + name: 'Composite', + className: 'ApplicationLogsConfig' + } + }, + httpLogs: { + required: false, + serializedName: 'properties.httpLogs', + type: { + name: 'Composite', + className: 'HttpLogsConfig' + } + }, + failedRequestsTracing: { + required: false, + serializedName: 'properties.failedRequestsTracing', + type: { + name: 'Composite', + className: 'EnabledConfig' + } + }, + detailedErrorMessages: { + required: false, + serializedName: 'properties.detailedErrorMessages', + type: { + name: 'Composite', + className: 'EnabledConfig' + } + } + } + } + }; + } +} + +module.exports = SiteLogsConfig; diff --git a/lib/services/websiteManagement2/lib/models/siteMachineKey.js b/lib/services/websiteManagement2/lib/models/siteMachineKey.js new file mode 100644 index 0000000000..e60a1445f6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteMachineKey.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'; + +/** + * MachineKey of an app. + * + */ +class SiteMachineKey { + /** + * Create a SiteMachineKey. + * @member {string} [validation] MachineKey validation. + * @member {string} [validationKey] Validation key. + * @member {string} [decryption] Algorithm used for decryption. + * @member {string} [decryptionKey] Decryption key. + */ + constructor() { + } + + /** + * Defines the metadata of SiteMachineKey + * + * @returns {object} metadata of SiteMachineKey + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteMachineKey', + type: { + name: 'Composite', + className: 'SiteMachineKey', + modelProperties: { + validation: { + required: false, + serializedName: 'validation', + type: { + name: 'String' + } + }, + validationKey: { + required: false, + serializedName: 'validationKey', + type: { + name: 'String' + } + }, + decryption: { + required: false, + serializedName: 'decryption', + type: { + name: 'String' + } + }, + decryptionKey: { + required: false, + serializedName: 'decryptionKey', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteMachineKey; 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/sitePhpErrorLogFlag.js b/lib/services/websiteManagement2/lib/models/sitePhpErrorLogFlag.js new file mode 100644 index 0000000000..bdd71e4e43 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/sitePhpErrorLogFlag.js @@ -0,0 +1,113 @@ +/* + * 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 PHP error logging flag. + * + * @extends models['ProxyOnlyResource'] + */ +class SitePhpErrorLogFlag extends models['ProxyOnlyResource'] { + /** + * Create a SitePhpErrorLogFlag. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SitePhpErrorLogFlag + * + * @returns {object} metadata of SitePhpErrorLogFlag + * + */ + mapper() { + return { + required: false, + serializedName: 'SitePhpErrorLogFlag', + type: { + name: 'Composite', + className: 'SitePhpErrorLogFlag', + 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' + } + }, + localLogErrors: { + required: false, + serializedName: 'properties.localLogErrors', + type: { + name: 'String' + } + }, + masterLogErrors: { + required: false, + serializedName: 'properties.masterLogErrors', + type: { + name: 'String' + } + }, + localLogErrorsMaxLength: { + required: false, + serializedName: 'properties.localLogErrorsMaxLength', + type: { + name: 'String' + } + }, + masterLogErrorsMaxLength: { + required: false, + serializedName: 'properties.masterLogErrorsMaxLength', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SitePhpErrorLogFlag; diff --git a/lib/services/websiteManagement2/lib/models/siteSeal.js b/lib/services/websiteManagement2/lib/models/siteSeal.js new file mode 100644 index 0000000000..42e247d6c4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteSeal.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Site seal + * + */ +class SiteSeal { + /** + * Create a SiteSeal. + * @member {string} html HTML snippet + */ + constructor() { + } + + /** + * Defines the metadata of SiteSeal + * + * @returns {object} metadata of SiteSeal + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteSeal', + type: { + name: 'Composite', + className: 'SiteSeal', + modelProperties: { + html: { + required: true, + serializedName: 'html', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteSeal; diff --git a/lib/services/websiteManagement2/lib/models/siteSealRequest.js b/lib/services/websiteManagement2/lib/models/siteSealRequest.js new file mode 100644 index 0000000000..1745db2223 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteSealRequest.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Site seal request. + * + */ +class SiteSealRequest { + /** + * Create a SiteSealRequest. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of SiteSealRequest + * + * @returns {object} metadata of SiteSealRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteSealRequest', + type: { + name: 'Composite', + className: 'SiteSealRequest', + modelProperties: { + lightTheme: { + required: false, + serializedName: 'lightTheme', + type: { + name: 'Boolean' + } + }, + locale: { + required: false, + serializedName: 'locale', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteSealRequest; diff --git a/lib/services/websiteManagement2/lib/models/siteSourceControl.js b/lib/services/websiteManagement2/lib/models/siteSourceControl.js new file mode 100644 index 0000000000..492efb717f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteSourceControl.js @@ -0,0 +1,123 @@ +/* + * 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'); + +/** + * Source control configuration for an app. + * + * @extends models['ProxyOnlyResource'] + */ +class SiteSourceControl extends models['ProxyOnlyResource'] { + /** + * Create a SiteSourceControl. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteSourceControl + * + * @returns {object} metadata of SiteSourceControl + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteSourceControl', + type: { + name: 'Composite', + className: 'SiteSourceControl', + 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' + } + }, + repoUrl: { + required: false, + serializedName: 'properties.repoUrl', + type: { + name: 'String' + } + }, + branch: { + required: false, + serializedName: 'properties.branch', + type: { + name: 'String' + } + }, + isManualIntegration: { + required: false, + serializedName: 'properties.isManualIntegration', + type: { + name: 'Boolean' + } + }, + deploymentRollbackEnabled: { + required: false, + serializedName: 'properties.deploymentRollbackEnabled', + type: { + name: 'Boolean' + } + }, + isMercurial: { + required: false, + serializedName: 'properties.isMercurial', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SiteSourceControl; diff --git a/lib/services/websiteManagement2/lib/models/skuCapacity.js b/lib/services/websiteManagement2/lib/models/skuCapacity.js new file mode 100644 index 0000000000..975b91bfd9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/skuCapacity.js @@ -0,0 +1,80 @@ +/* + * 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 the App Service plan scale options. + * + */ +class SkuCapacity { + /** + * Create a SkuCapacity. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of SkuCapacity + * + * @returns {object} metadata of SkuCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuCapacity', + type: { + name: 'Composite', + className: 'SkuCapacity', + modelProperties: { + minimum: { + required: false, + serializedName: 'minimum', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + serializedName: 'maximum', + type: { + name: 'Number' + } + }, + default: { + required: false, + serializedName: 'default', + type: { + name: 'Number' + } + }, + scaleType: { + required: false, + serializedName: 'scaleType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuCapacity; diff --git a/lib/services/websiteManagement2/lib/models/skuDescription.js b/lib/services/websiteManagement2/lib/models/skuDescription.js new file mode 100644 index 0000000000..ae5f70eaaf --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/skuDescription.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'; + +/** + * Description of a SKU for a scalable resource. + * + */ +class SkuDescription { + /** + * Create a SkuDescription. + * @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? + */ + constructor() { + } + + /** + * Defines the metadata of SkuDescription + * + * @returns {object} metadata of SkuDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuDescription', + type: { + name: 'Composite', + className: 'SkuDescription', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + size: { + required: false, + serializedName: 'size', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Number' + } + }, + skuCapacity: { + required: false, + serializedName: 'skuCapacity', + type: { + name: 'Composite', + className: 'SkuCapacity' + } + }, + locations: { + required: false, + serializedName: 'locations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + capabilities: { + required: false, + serializedName: 'capabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CapabilityElementType', + type: { + name: 'Composite', + className: 'Capability' + } + } + } + } + } + } + }; + } +} + +module.exports = SkuDescription; diff --git a/lib/services/websiteManagement2/lib/models/skuInfo.js b/lib/services/websiteManagement2/lib/models/skuInfo.js new file mode 100644 index 0000000000..1af7a35617 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/skuInfo.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'; + +/** + * SKU discovery information. + * + */ +class SkuInfo { + /** + * Create a SkuInfo. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of SkuInfo + * + * @returns {object} metadata of SkuInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuInfo', + type: { + name: 'Composite', + className: 'SkuInfo', + modelProperties: { + resourceType: { + required: false, + serializedName: 'resourceType', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'SkuDescription' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Composite', + className: 'SkuCapacity' + } + } + } + } + }; + } +} + +module.exports = SkuInfo; diff --git a/lib/services/websiteManagement2/lib/models/skuInfoCollection.js b/lib/services/websiteManagement2/lib/models/skuInfoCollection.js new file mode 100644 index 0000000000..d82ba762bd --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/skuInfoCollection.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 SKU information. + */ +class SkuInfoCollection extends Array { + /** + * Create a SkuInfoCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SkuInfoCollection + * + * @returns {object} metadata of SkuInfoCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuInfoCollection', + type: { + name: 'Composite', + className: 'SkuInfoCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SkuInfoElementType', + type: { + name: 'Composite', + className: 'SkuInfo' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuInfoCollection; diff --git a/lib/services/websiteManagement2/lib/models/skuInfos.js b/lib/services/websiteManagement2/lib/models/skuInfos.js new file mode 100644 index 0000000000..30d2ba0b63 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/skuInfos.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 SKU information. + * + */ +class SkuInfos { + /** + * Create a SkuInfos. + * @member {string} [resourceType] Resource type that this SKU applies to. + * @member {array} [skus] List of SKUs the subscription is able to use. + */ + constructor() { + } + + /** + * Defines the metadata of SkuInfos + * + * @returns {object} metadata of SkuInfos + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuInfos', + type: { + name: 'Composite', + className: 'SkuInfos', + modelProperties: { + resourceType: { + required: false, + serializedName: 'resourceType', + type: { + name: 'String' + } + }, + skus: { + required: false, + serializedName: 'skus', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GlobalCsmSkuDescriptionElementType', + type: { + name: 'Composite', + className: 'GlobalCsmSkuDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = SkuInfos; diff --git a/lib/services/websiteManagement2/lib/models/slotConfigNamesResource.js b/lib/services/websiteManagement2/lib/models/slotConfigNamesResource.js new file mode 100644 index 0000000000..7bdcaa83e2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/slotConfigNamesResource.js @@ -0,0 +1,125 @@ +/* + * 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'); + +/** + * Slot Config names azure resource. + * + * @extends models['ProxyOnlyResource'] + */ +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(); + } + + /** + * Defines the metadata of SlotConfigNamesResource + * + * @returns {object} metadata of SlotConfigNamesResource + * + */ + mapper() { + return { + required: false, + serializedName: 'SlotConfigNamesResource', + type: { + name: 'Composite', + className: 'SlotConfigNamesResource', + 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' + } + }, + connectionStringNames: { + required: false, + serializedName: 'properties.connectionStringNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + appSettingNames: { + required: false, + serializedName: 'properties.appSettingNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + azureStorageConfigNames: { + required: false, + serializedName: 'properties.azureStorageConfigNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = SlotConfigNamesResource; 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/slotDifferenceCollection.js b/lib/services/websiteManagement2/lib/models/slotDifferenceCollection.js new file mode 100644 index 0000000000..ff836aff95 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/slotDifferenceCollection.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 slot differences. + */ +class SlotDifferenceCollection extends Array { + /** + * Create a SlotDifferenceCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SlotDifferenceCollection + * + * @returns {object} metadata of SlotDifferenceCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'SlotDifferenceCollection', + type: { + name: 'Composite', + className: 'SlotDifferenceCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SlotDifferenceElementType', + type: { + name: 'Composite', + className: 'SlotDifference' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SlotDifferenceCollection; diff --git a/lib/services/websiteManagement2/lib/models/slotSwapStatus.js b/lib/services/websiteManagement2/lib/models/slotSwapStatus.js new file mode 100644 index 0000000000..6d399a5285 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/slotSwapStatus.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 status of the last successfull slot swap operation. + * + */ +class SlotSwapStatus { + /** + * Create a SlotSwapStatus. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of SlotSwapStatus + * + * @returns {object} metadata of SlotSwapStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'SlotSwapStatus', + type: { + name: 'Composite', + className: 'SlotSwapStatus', + modelProperties: { + timestampUtc: { + required: false, + readOnly: true, + serializedName: 'timestampUtc', + type: { + name: 'DateTime' + } + }, + sourceSlotName: { + required: false, + readOnly: true, + serializedName: 'sourceSlotName', + type: { + name: 'String' + } + }, + destinationSlotName: { + required: false, + readOnly: true, + serializedName: 'destinationSlotName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SlotSwapStatus; diff --git a/lib/services/websiteManagement2/lib/models/slowRequestsBasedTrigger.js b/lib/services/websiteManagement2/lib/models/slowRequestsBasedTrigger.js new file mode 100644 index 0000000000..30602cb26d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/slowRequestsBasedTrigger.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'; + +/** + * Trigger based on request execution time. + * + */ +class SlowRequestsBasedTrigger { + /** + * Create a SlowRequestsBasedTrigger. + * @member {string} [timeTaken] Time taken. + * @member {number} [count] Request Count. + * @member {string} [timeInterval] Time interval. + */ + constructor() { + } + + /** + * Defines the metadata of SlowRequestsBasedTrigger + * + * @returns {object} metadata of SlowRequestsBasedTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'SlowRequestsBasedTrigger', + type: { + name: 'Composite', + className: 'SlowRequestsBasedTrigger', + modelProperties: { + timeTaken: { + required: false, + serializedName: 'timeTaken', + type: { + name: 'String' + } + }, + count: { + required: false, + serializedName: 'count', + type: { + name: 'Number' + } + }, + timeInterval: { + required: false, + serializedName: 'timeInterval', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SlowRequestsBasedTrigger; diff --git a/lib/services/websiteManagement2/lib/models/snapshot.js b/lib/services/websiteManagement2/lib/models/snapshot.js new file mode 100644 index 0000000000..9420d3e70c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/snapshot.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 snapshot of an app. + * + * @extends models['ProxyOnlyResource'] + */ +class Snapshot extends models['ProxyOnlyResource'] { + /** + * Create a Snapshot. + * @member {string} [time] The time the snapshot was taken. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Snapshot + * + * @returns {object} metadata of Snapshot + * + */ + mapper() { + return { + required: false, + serializedName: 'Snapshot', + type: { + name: 'Composite', + className: 'Snapshot', + 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: 'String' + } + } + } + } + }; + } +} + +module.exports = Snapshot; diff --git a/lib/services/websiteManagement2/lib/models/snapshotCollection.js b/lib/services/websiteManagement2/lib/models/snapshotCollection.js new file mode 100644 index 0000000000..b6729f556f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/snapshotCollection.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'; + +/** + * Collection of snapshots which can be used to revert an app to a previous + * time. + */ +class SnapshotCollection extends Array { + /** + * Create a SnapshotCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SnapshotCollection + * + * @returns {object} metadata of SnapshotCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotCollection', + type: { + name: 'Composite', + className: 'SnapshotCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SnapshotElementType', + type: { + name: 'Composite', + className: 'Snapshot' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SnapshotCollection; diff --git a/lib/services/websiteManagement2/lib/models/snapshotRecoverySource.js b/lib/services/websiteManagement2/lib/models/snapshotRecoverySource.js new file mode 100644 index 0000000000..e545007e99 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/snapshotRecoverySource.js @@ -0,0 +1,65 @@ +/* + * 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'; + +/** + * Specifies the web app that snapshot contents will be retrieved from. + * + */ +class SnapshotRecoverySource { + /** + * Create a SnapshotRecoverySource. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of SnapshotRecoverySource + * + * @returns {object} metadata of SnapshotRecoverySource + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotRecoverySource', + type: { + name: 'Composite', + className: 'SnapshotRecoverySource', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SnapshotRecoverySource; diff --git a/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js b/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js new file mode 100644 index 0000000000..ad5d840c8a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js @@ -0,0 +1,134 @@ +/* + * 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'); + +/** + * Details about app recovery operation. + * + * @extends models['ProxyOnlyResource'] + */ +class SnapshotRestoreRequest extends models['ProxyOnlyResource'] { + /** + * Create a SnapshotRestoreRequest. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SnapshotRestoreRequest + * + * @returns {object} metadata of SnapshotRestoreRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotRestoreRequest', + type: { + name: 'Composite', + className: 'SnapshotRestoreRequest', + 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' + } + }, + snapshotTime: { + required: false, + serializedName: 'properties.snapshotTime', + type: { + name: 'String' + } + }, + recoverySource: { + required: false, + serializedName: 'properties.recoverySource', + type: { + name: 'Composite', + className: 'SnapshotRecoverySource' + } + }, + overwrite: { + required: true, + serializedName: 'properties.overwrite', + type: { + name: 'Boolean' + } + }, + recoverConfiguration: { + required: false, + serializedName: 'properties.recoverConfiguration', + type: { + name: 'Boolean' + } + }, + ignoreConflictingHostNames: { + required: false, + serializedName: 'properties.ignoreConflictingHostNames', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SnapshotRestoreRequest; diff --git a/lib/services/websiteManagement2/lib/models/solution.js b/lib/services/websiteManagement2/lib/models/solution.js new file mode 100644 index 0000000000..31d4126612 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/solution.js @@ -0,0 +1,132 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class Representing Solution for problems detected. + * + */ +class Solution { + /** + * Create a Solution. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of Solution + * + * @returns {object} metadata of Solution + * + */ + mapper() { + return { + required: false, + serializedName: 'Solution', + type: { + name: 'Composite', + className: 'Solution', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'Number' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + order: { + required: false, + serializedName: 'order', + type: { + name: 'Number' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'QuickSolution', 'DeepInvestigation', 'BestPractices' ] + } + }, + data: { + required: false, + serializedName: 'data', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + } + } + }, + metadata: { + required: false, + serializedName: 'metadata', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + } + } + } + } + } + }; + } +} + +module.exports = Solution; 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/sourceControlCollection.js b/lib/services/websiteManagement2/lib/models/sourceControlCollection.js new file mode 100644 index 0000000000..9fd89247ed --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/sourceControlCollection.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 source controls. + */ +class SourceControlCollection extends Array { + /** + * Create a SourceControlCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SourceControlCollection + * + * @returns {object} metadata of SourceControlCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlCollection', + type: { + name: 'Composite', + className: 'SourceControlCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceControlElementType', + type: { + name: 'Composite', + className: 'SourceControl' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlCollection; diff --git a/lib/services/websiteManagement2/lib/models/stackMajorVersion.js b/lib/services/websiteManagement2/lib/models/stackMajorVersion.js new file mode 100644 index 0000000000..6e76522dfb --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/stackMajorVersion.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'; + +/** + * Application stack major version. + * + */ +class StackMajorVersion { + /** + * Create a StackMajorVersion. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of StackMajorVersion + * + * @returns {object} metadata of StackMajorVersion + * + */ + mapper() { + return { + required: false, + serializedName: 'StackMajorVersion', + type: { + name: 'Composite', + className: 'StackMajorVersion', + modelProperties: { + displayVersion: { + required: false, + serializedName: 'displayVersion', + type: { + name: 'String' + } + }, + runtimeVersion: { + required: false, + serializedName: 'runtimeVersion', + type: { + name: 'String' + } + }, + isDefault: { + required: false, + serializedName: 'isDefault', + type: { + name: 'Boolean' + } + }, + minorVersions: { + required: false, + serializedName: 'minorVersions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StackMinorVersionElementType', + type: { + name: 'Composite', + className: 'StackMinorVersion' + } + } + } + } + } + } + }; + } +} + +module.exports = StackMajorVersion; diff --git a/lib/services/websiteManagement2/lib/models/stackMinorVersion.js b/lib/services/websiteManagement2/lib/models/stackMinorVersion.js new file mode 100644 index 0000000000..2154f681e0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/stackMinorVersion.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Application stack minor version. + * + */ +class StackMinorVersion { + /** + * Create a StackMinorVersion. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of StackMinorVersion + * + * @returns {object} metadata of StackMinorVersion + * + */ + mapper() { + return { + required: false, + serializedName: 'StackMinorVersion', + type: { + name: 'Composite', + className: 'StackMinorVersion', + modelProperties: { + displayVersion: { + required: false, + serializedName: 'displayVersion', + type: { + name: 'String' + } + }, + runtimeVersion: { + required: false, + serializedName: 'runtimeVersion', + type: { + name: 'String' + } + }, + isDefault: { + required: false, + serializedName: 'isDefault', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = StackMinorVersion; 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/stampCapacityCollection.js b/lib/services/websiteManagement2/lib/models/stampCapacityCollection.js new file mode 100644 index 0000000000..0d06935381 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/stampCapacityCollection.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 stamp capacities. + */ +class StampCapacityCollection extends Array { + /** + * Create a StampCapacityCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StampCapacityCollection + * + * @returns {object} metadata of StampCapacityCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'StampCapacityCollection', + type: { + name: 'Composite', + className: 'StampCapacityCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StampCapacityElementType', + type: { + name: 'Composite', + className: 'StampCapacity' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = StampCapacityCollection; diff --git a/lib/services/websiteManagement2/lib/models/statusCodesBasedTrigger.js b/lib/services/websiteManagement2/lib/models/statusCodesBasedTrigger.js new file mode 100644 index 0000000000..dbbf1ac65e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/statusCodesBasedTrigger.js @@ -0,0 +1,84 @@ +/* + * 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'; + +/** + * Trigger based on status code. + * + */ +class StatusCodesBasedTrigger { + /** + * Create a StatusCodesBasedTrigger. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of StatusCodesBasedTrigger + * + * @returns {object} metadata of StatusCodesBasedTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'StatusCodesBasedTrigger', + type: { + name: 'Composite', + className: 'StatusCodesBasedTrigger', + modelProperties: { + status: { + required: false, + serializedName: 'status', + type: { + name: 'Number' + } + }, + subStatus: { + required: false, + serializedName: 'subStatus', + type: { + name: 'Number' + } + }, + win32Status: { + required: false, + serializedName: 'win32Status', + type: { + name: 'Number' + } + }, + count: { + required: false, + serializedName: 'count', + type: { + name: 'Number' + } + }, + timeInterval: { + required: false, + serializedName: 'timeInterval', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = StatusCodesBasedTrigger; diff --git a/lib/services/websiteManagement2/lib/models/storageMigrationOptions.js b/lib/services/websiteManagement2/lib/models/storageMigrationOptions.js new file mode 100644 index 0000000000..de8a5cd59a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/storageMigrationOptions.js @@ -0,0 +1,117 @@ +/* + * 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'); + +/** + * Options for app content migration. + * + * @extends models['ProxyOnlyResource'] + */ +class StorageMigrationOptions extends models['ProxyOnlyResource'] { + /** + * Create a StorageMigrationOptions. + * @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 . + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StorageMigrationOptions + * + * @returns {object} metadata of StorageMigrationOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageMigrationOptions', + type: { + name: 'Composite', + className: 'StorageMigrationOptions', + 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' + } + }, + azurefilesConnectionString: { + required: true, + serializedName: 'properties.azurefilesConnectionString', + type: { + name: 'String' + } + }, + azurefilesShare: { + required: true, + serializedName: 'properties.azurefilesShare', + type: { + name: 'String' + } + }, + switchSiteAfterMigration: { + required: false, + serializedName: 'properties.switchSiteAfterMigration', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + blockWriteAccessToSite: { + required: false, + serializedName: 'properties.blockWriteAccessToSite', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = StorageMigrationOptions; diff --git a/lib/services/websiteManagement2/lib/models/storageMigrationResponse.js b/lib/services/websiteManagement2/lib/models/storageMigrationResponse.js new file mode 100644 index 0000000000..06af20fad8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/storageMigrationResponse.js @@ -0,0 +1,90 @@ +/* + * 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'); + +/** + * Response for a migration of app content request. + * + * @extends models['ProxyOnlyResource'] + */ +class StorageMigrationResponse extends models['ProxyOnlyResource'] { + /** + * Create a StorageMigrationResponse. + * @member {string} [operationId] When server starts the migration process, + * it will return an operation ID identifying that particular migration + * operation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StorageMigrationResponse + * + * @returns {object} metadata of StorageMigrationResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageMigrationResponse', + type: { + name: 'Composite', + className: 'StorageMigrationResponse', + 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' + } + }, + operationId: { + required: false, + readOnly: true, + serializedName: 'properties.operationId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = StorageMigrationResponse; diff --git a/lib/services/websiteManagement2/lib/models/stringDictionary.js b/lib/services/websiteManagement2/lib/models/stringDictionary.js new file mode 100644 index 0000000000..38f97b7edb --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/stringDictionary.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * String dictionary resource. + * + * @extends models['ProxyOnlyResource'] + */ +class StringDictionary extends models['ProxyOnlyResource'] { + /** + * Create a StringDictionary. + * @member {object} [properties] Settings. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StringDictionary + * + * @returns {object} metadata of StringDictionary + * + */ + mapper() { + return { + required: false, + serializedName: 'StringDictionary', + type: { + name: 'Composite', + className: 'StringDictionary', + 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: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = StringDictionary; diff --git a/lib/services/websiteManagement2/lib/models/swiftVirtualNetwork.js b/lib/services/websiteManagement2/lib/models/swiftVirtualNetwork.js new file mode 100644 index 0000000000..7001e790fd --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/swiftVirtualNetwork.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'; + +const models = require('./index'); + +/** + * Swift Virtual Network Contract. This is used to enable the new Swift way of + * doing virtual network integration. + * + * @extends models['ProxyOnlyResource'] + */ +class SwiftVirtualNetwork extends models['ProxyOnlyResource'] { + /** + * Create a SwiftVirtualNetwork. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SwiftVirtualNetwork + * + * @returns {object} metadata of SwiftVirtualNetwork + * + */ + mapper() { + return { + required: false, + serializedName: 'SwiftVirtualNetwork', + type: { + name: 'Composite', + className: 'SwiftVirtualNetwork', + 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' + } + }, + subnetResourceId: { + required: false, + serializedName: 'properties.subnetResourceId', + type: { + name: 'String' + } + }, + swiftSupported: { + required: false, + serializedName: 'properties.swiftSupported', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SwiftVirtualNetwork; diff --git a/lib/services/websiteManagement2/lib/models/tldLegalAgreement.js b/lib/services/websiteManagement2/lib/models/tldLegalAgreement.js new file mode 100644 index 0000000000..55671d5cb5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/tldLegalAgreement.js @@ -0,0 +1,77 @@ +/* + * 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'; + +/** + * Legal agreement for a top level domain. + * + */ +class TldLegalAgreement { + /** + * Create a TldLegalAgreement. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of TldLegalAgreement + * + * @returns {object} metadata of TldLegalAgreement + * + */ + mapper() { + return { + required: false, + serializedName: 'TldLegalAgreement', + type: { + name: 'Composite', + className: 'TldLegalAgreement', + modelProperties: { + agreementKey: { + required: true, + serializedName: 'agreementKey', + type: { + name: 'String' + } + }, + title: { + required: true, + serializedName: 'title', + type: { + name: 'String' + } + }, + content: { + required: true, + serializedName: 'content', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'url', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TldLegalAgreement; diff --git a/lib/services/websiteManagement2/lib/models/tldLegalAgreementCollection.js b/lib/services/websiteManagement2/lib/models/tldLegalAgreementCollection.js new file mode 100644 index 0000000000..78ce4ed7f2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/tldLegalAgreementCollection.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 top-level domain legal agreements. + */ +class TldLegalAgreementCollection extends Array { + /** + * Create a TldLegalAgreementCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TldLegalAgreementCollection + * + * @returns {object} metadata of TldLegalAgreementCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'TldLegalAgreementCollection', + type: { + name: 'Composite', + className: 'TldLegalAgreementCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TldLegalAgreementElementType', + type: { + name: 'Composite', + className: 'TldLegalAgreement' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TldLegalAgreementCollection; 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/topLevelDomainAgreementOption.js b/lib/services/websiteManagement2/lib/models/topLevelDomainAgreementOption.js new file mode 100644 index 0000000000..f444781f37 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/topLevelDomainAgreementOption.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Options for retrieving the list of top level domain legal agreements. + * + */ +class TopLevelDomainAgreementOption { + /** + * Create a TopLevelDomainAgreementOption. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of TopLevelDomainAgreementOption + * + * @returns {object} metadata of TopLevelDomainAgreementOption + * + */ + mapper() { + return { + required: false, + serializedName: 'TopLevelDomainAgreementOption', + type: { + name: 'Composite', + className: 'TopLevelDomainAgreementOption', + modelProperties: { + includePrivacy: { + required: false, + serializedName: 'includePrivacy', + type: { + name: 'Boolean' + } + }, + forTransfer: { + required: false, + serializedName: 'forTransfer', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = TopLevelDomainAgreementOption; diff --git a/lib/services/websiteManagement2/lib/models/topLevelDomainCollection.js b/lib/services/websiteManagement2/lib/models/topLevelDomainCollection.js new file mode 100644 index 0000000000..aa7c32fbb3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/topLevelDomainCollection.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 Top-level domains. + */ +class TopLevelDomainCollection extends Array { + /** + * Create a TopLevelDomainCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TopLevelDomainCollection + * + * @returns {object} metadata of TopLevelDomainCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'TopLevelDomainCollection', + type: { + name: 'Composite', + className: 'TopLevelDomainCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TopLevelDomainElementType', + type: { + name: 'Composite', + className: 'TopLevelDomain' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TopLevelDomainCollection; 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/triggeredJobHistoryCollection.js b/lib/services/websiteManagement2/lib/models/triggeredJobHistoryCollection.js new file mode 100644 index 0000000000..37516f3fba --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/triggeredJobHistoryCollection.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 TriggeredJobHistoryCollection extends Array { + /** + * Create a TriggeredJobHistoryCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TriggeredJobHistoryCollection + * + * @returns {object} metadata of TriggeredJobHistoryCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggeredJobHistoryCollection', + type: { + name: 'Composite', + className: 'TriggeredJobHistoryCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TriggeredJobHistoryElementType', + type: { + name: 'Composite', + className: 'TriggeredJobHistory' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TriggeredJobHistoryCollection; 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/triggeredWebJobCollection.js b/lib/services/websiteManagement2/lib/models/triggeredWebJobCollection.js new file mode 100644 index 0000000000..4affcd2633 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/triggeredWebJobCollection.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 TriggeredWebJobCollection extends Array { + /** + * Create a TriggeredWebJobCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TriggeredWebJobCollection + * + * @returns {object} metadata of TriggeredWebJobCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggeredWebJobCollection', + type: { + name: 'Composite', + className: 'TriggeredWebJobCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TriggeredWebJobElementType', + type: { + name: 'Composite', + className: 'TriggeredWebJob' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TriggeredWebJobCollection; 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/usageCollection.js b/lib/services/websiteManagement2/lib/models/usageCollection.js new file mode 100644 index 0000000000..566e79b52b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/usageCollection.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 usages. + */ +class UsageCollection extends Array { + /** + * Create a UsageCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of UsageCollection + * + * @returns {object} metadata of UsageCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'UsageCollection', + type: { + name: 'Composite', + className: 'UsageCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UsageElementType', + type: { + name: 'Composite', + className: 'Usage' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UsageCollection; 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 new file mode 100644 index 0000000000..f5bc588415 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/validateResponse.js @@ -0,0 +1,63 @@ +/* + * 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'; + +/** + * Describes the result of resource validation. + * + */ +class ValidateResponse { + /** + * Create a ValidateResponse. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of ValidateResponse + * + * @returns {object} metadata of ValidateResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateResponse', + type: { + name: 'Composite', + className: 'ValidateResponse', + modelProperties: { + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + error: { + required: false, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ValidateResponseError' + } + } + } + } + }; + } +} + +module.exports = ValidateResponse; diff --git a/lib/services/websiteManagement2/lib/models/validateResponseError.js b/lib/services/websiteManagement2/lib/models/validateResponseError.js new file mode 100644 index 0000000000..3fecb30d68 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/validateResponseError.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Error details for when validation fails. + * + */ +class ValidateResponseError { + /** + * Create a ValidateResponseError. + * @member {string} [code] Validation error code. + * @member {string} [message] Validation error message. + */ + constructor() { + } + + /** + * Defines the metadata of ValidateResponseError + * + * @returns {object} metadata of ValidateResponseError + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateResponseError', + type: { + name: 'Composite', + className: 'ValidateResponseError', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ValidateResponseError; diff --git a/lib/services/websiteManagement2/lib/models/virtualApplication.js b/lib/services/websiteManagement2/lib/models/virtualApplication.js new file mode 100644 index 0000000000..0f5a6a66e4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/virtualApplication.js @@ -0,0 +1,86 @@ +/* + * 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'; + +/** + * Virtual application in an app. + * + */ +class VirtualApplication { + /** + * Create a VirtualApplication. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualApplication + * + * @returns {object} metadata of VirtualApplication + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualApplication', + type: { + name: 'Composite', + className: 'VirtualApplication', + modelProperties: { + virtualPath: { + required: false, + serializedName: 'virtualPath', + type: { + name: 'String' + } + }, + physicalPath: { + required: false, + serializedName: 'physicalPath', + type: { + name: 'String' + } + }, + preloadEnabled: { + required: false, + serializedName: 'preloadEnabled', + type: { + name: 'Boolean' + } + }, + virtualDirectories: { + required: false, + serializedName: 'virtualDirectories', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualDirectoryElementType', + type: { + name: 'Composite', + className: 'VirtualDirectory' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualApplication; diff --git a/lib/services/websiteManagement2/lib/models/virtualDirectory.js b/lib/services/websiteManagement2/lib/models/virtualDirectory.js new file mode 100644 index 0000000000..6950d3d013 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/virtualDirectory.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Directory for virtual application. + * + */ +class VirtualDirectory { + /** + * Create a VirtualDirectory. + * @member {string} [virtualPath] Path to virtual application. + * @member {string} [physicalPath] Physical path. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualDirectory + * + * @returns {object} metadata of VirtualDirectory + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualDirectory', + type: { + name: 'Composite', + className: 'VirtualDirectory', + modelProperties: { + virtualPath: { + required: false, + serializedName: 'virtualPath', + type: { + name: 'String' + } + }, + physicalPath: { + required: false, + serializedName: 'physicalPath', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualDirectory; diff --git a/lib/services/websiteManagement2/lib/models/virtualIPMapping.js b/lib/services/websiteManagement2/lib/models/virtualIPMapping.js new file mode 100644 index 0000000000..34ac5296e9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/virtualIPMapping.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'; + +/** + * Virtual IP mapping. + * + */ +class VirtualIPMapping { + /** + * Create a VirtualIPMapping. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualIPMapping + * + * @returns {object} metadata of VirtualIPMapping + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualIPMapping', + type: { + name: 'Composite', + className: 'VirtualIPMapping', + modelProperties: { + virtualIP: { + required: false, + serializedName: 'virtualIP', + type: { + name: 'String' + } + }, + internalHttpPort: { + required: false, + serializedName: 'internalHttpPort', + type: { + name: 'Number' + } + }, + internalHttpsPort: { + required: false, + serializedName: 'internalHttpsPort', + type: { + name: 'Number' + } + }, + inUse: { + required: false, + serializedName: 'inUse', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = VirtualIPMapping; diff --git a/lib/services/websiteManagement2/lib/models/virtualNetworkProfile.js b/lib/services/websiteManagement2/lib/models/virtualNetworkProfile.js new file mode 100644 index 0000000000..c1f1b1b162 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/virtualNetworkProfile.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * Specification for using a Virtual Network. + * + */ +class VirtualNetworkProfile { + /** + * Create a VirtualNetworkProfile. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualNetworkProfile + * + * @returns {object} metadata of VirtualNetworkProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkProfile', + type: { + name: 'Composite', + className: 'VirtualNetworkProfile', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'subnet', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkProfile; diff --git a/lib/services/websiteManagement2/lib/models/vnetGateway.js b/lib/services/websiteManagement2/lib/models/vnetGateway.js new file mode 100644 index 0000000000..1019567d6e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/vnetGateway.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'); + +/** + * The Virtual Network gateway contract. This is used to give the Virtual + * Network gateway access to the VPN package. + * + * @extends models['ProxyOnlyResource'] + */ +class VnetGateway extends models['ProxyOnlyResource'] { + /** + * Create a VnetGateway. + * @member {string} [vnetName] The Virtual Network name. + * @member {string} vpnPackageUri The URI where the VPN package can be + * downloaded. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VnetGateway + * + * @returns {object} metadata of VnetGateway + * + */ + mapper() { + return { + required: false, + serializedName: 'VnetGateway', + type: { + name: 'Composite', + className: 'VnetGateway', + 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' + } + }, + vnetName: { + required: false, + serializedName: 'properties.vnetName', + type: { + name: 'String' + } + }, + vpnPackageUri: { + required: true, + serializedName: 'properties.vpnPackageUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VnetGateway; diff --git a/lib/services/websiteManagement2/lib/models/vnetInfo.js b/lib/services/websiteManagement2/lib/models/vnetInfo.js new file mode 100644 index 0000000000..6340d209a5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/vnetInfo.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'); + +/** + * Virtual Network information contract. + * + * @extends models['ProxyOnlyResource'] + */ +class VnetInfo extends models['ProxyOnlyResource'] { + /** + * Create a VnetInfo. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VnetInfo + * + * @returns {object} metadata of VnetInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'VnetInfo', + type: { + name: 'Composite', + className: 'VnetInfo', + 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' + } + }, + vnetResourceId: { + required: false, + serializedName: 'properties.vnetResourceId', + type: { + name: 'String' + } + }, + certThumbprint: { + required: false, + readOnly: true, + serializedName: 'properties.certThumbprint', + type: { + name: 'String' + } + }, + certBlob: { + required: false, + serializedName: 'properties.certBlob', + type: { + name: 'ByteArray' + } + }, + routes: { + required: false, + readOnly: true, + serializedName: 'properties.routes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetRouteElementType', + type: { + name: 'Composite', + className: 'VnetRoute' + } + } + } + }, + resyncRequired: { + required: false, + readOnly: true, + serializedName: 'properties.resyncRequired', + type: { + name: 'Boolean' + } + }, + dnsServers: { + required: false, + serializedName: 'properties.dnsServers', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VnetInfo; diff --git a/lib/services/websiteManagement2/lib/models/vnetParameters.js b/lib/services/websiteManagement2/lib/models/vnetParameters.js new file mode 100644 index 0000000000..a3a8a850f0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/vnetParameters.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'); + +/** + * The required set of inputs to validate a VNET + * + * @extends models['ProxyOnlyResource'] + */ +class VnetParameters extends models['ProxyOnlyResource'] { + /** + * Create a VnetParameters. + * @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 + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VnetParameters + * + * @returns {object} metadata of VnetParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'VnetParameters', + type: { + name: 'Composite', + className: 'VnetParameters', + 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' + } + }, + vnetResourceGroup: { + required: false, + serializedName: 'properties.vnetResourceGroup', + type: { + name: 'String' + } + }, + vnetName: { + required: false, + serializedName: 'properties.vnetName', + type: { + name: 'String' + } + }, + vnetSubnetName: { + required: false, + serializedName: 'properties.vnetSubnetName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VnetParameters; 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/vnetValidationFailureDetails.js b/lib/services/websiteManagement2/lib/models/vnetValidationFailureDetails.js new file mode 100644 index 0000000000..f8b35f16b6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/vnetValidationFailureDetails.js @@ -0,0 +1,105 @@ +/* + * 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 class that describes the reason for a validation failure. + * + * @extends models['ProxyOnlyResource'] + */ +class VnetValidationFailureDetails extends models['ProxyOnlyResource'] { + /** + * Create a VnetValidationFailureDetails. + * @member {boolean} [failed] A flag describing whether or not validation + * failed. + * @member {array} [failedTests] A list of tests that failed in the + * validation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VnetValidationFailureDetails + * + * @returns {object} metadata of VnetValidationFailureDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'VnetValidationFailureDetails', + type: { + name: 'Composite', + className: 'VnetValidationFailureDetails', + 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' + } + }, + failed: { + required: false, + serializedName: 'properties.failed', + type: { + name: 'Boolean' + } + }, + failedTests: { + required: false, + serializedName: 'properties.failedTests', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetValidationTestFailureElementType', + type: { + name: 'Composite', + className: 'VnetValidationTestFailure' + } + } + } + } + } + } + }; + } +} + +module.exports = VnetValidationFailureDetails; diff --git a/lib/services/websiteManagement2/lib/models/vnetValidationTestFailure.js b/lib/services/websiteManagement2/lib/models/vnetValidationTestFailure.js new file mode 100644 index 0000000000..bc2219df3a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/vnetValidationTestFailure.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'); + +/** + * A class that describes a test that failed during NSG and UDR validation. + * + * @extends models['ProxyOnlyResource'] + */ +class VnetValidationTestFailure extends models['ProxyOnlyResource'] { + /** + * Create a VnetValidationTestFailure. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VnetValidationTestFailure + * + * @returns {object} metadata of VnetValidationTestFailure + * + */ + mapper() { + return { + required: false, + serializedName: 'VnetValidationTestFailure', + type: { + name: 'Composite', + className: 'VnetValidationTestFailure', + 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' + } + }, + testName: { + required: false, + serializedName: 'properties.testName', + type: { + name: 'String' + } + }, + details: { + required: false, + serializedName: 'properties.details', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VnetValidationTestFailure; diff --git a/lib/services/websiteManagement2/lib/models/webAppCollection.js b/lib/services/websiteManagement2/lib/models/webAppCollection.js new file mode 100644 index 0000000000..48876fe2b2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/webAppCollection.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 apps. + */ +class WebAppCollection extends Array { + /** + * Create a WebAppCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WebAppCollection + * + * @returns {object} metadata of WebAppCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'WebAppCollection', + type: { + name: 'Composite', + className: 'WebAppCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SiteElementType', + type: { + name: 'Composite', + className: 'Site' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WebAppCollection; diff --git a/lib/services/websiteManagement2/lib/models/webAppInstanceCollection.js b/lib/services/websiteManagement2/lib/models/webAppInstanceCollection.js new file mode 100644 index 0000000000..326dc57d43 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/webAppInstanceCollection.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 instances. + */ +class WebAppInstanceCollection extends Array { + /** + * Create a WebAppInstanceCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WebAppInstanceCollection + * + * @returns {object} metadata of WebAppInstanceCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'WebAppInstanceCollection', + type: { + name: 'Composite', + className: 'WebAppInstanceCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SiteInstanceElementType', + type: { + name: 'Composite', + className: 'SiteInstance' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WebAppInstanceCollection; 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/models/webJobCollection.js b/lib/services/websiteManagement2/lib/models/webJobCollection.js new file mode 100644 index 0000000000..6e3f47cb45 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/webJobCollection.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 web job information elements. + */ +class WebJobCollection extends Array { + /** + * Create a WebJobCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WebJobCollection + * + * @returns {object} metadata of WebJobCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'WebJobCollection', + type: { + name: 'Composite', + className: 'WebJobCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WebJobElementType', + type: { + name: 'Composite', + className: 'WebJob' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WebJobCollection; diff --git a/lib/services/websiteManagement2/lib/models/workerPool.js b/lib/services/websiteManagement2/lib/models/workerPool.js new file mode 100644 index 0000000000..b7896d3594 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/workerPool.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'; + +/** + * Worker pool of an App Service Environment. + * + */ +class WorkerPool { + /** + * Create a WorkerPool. + * @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). + */ + constructor() { + } + + /** + * Defines the metadata of WorkerPool + * + * @returns {object} metadata of WorkerPool + * + */ + mapper() { + return { + required: false, + serializedName: 'WorkerPool', + type: { + name: 'Composite', + className: 'WorkerPool', + modelProperties: { + workerSizeId: { + required: false, + serializedName: 'workerSizeId', + type: { + name: 'Number' + } + }, + computeMode: { + required: false, + serializedName: 'computeMode', + type: { + name: 'Enum', + allowedValues: [ 'Shared', 'Dedicated', 'Dynamic' ] + } + }, + workerSize: { + required: false, + serializedName: 'workerSize', + type: { + name: 'String' + } + }, + workerCount: { + required: false, + serializedName: 'workerCount', + type: { + name: 'Number' + } + }, + instanceNames: { + required: false, + readOnly: true, + serializedName: 'instanceNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = WorkerPool; diff --git a/lib/services/websiteManagement2/lib/models/workerPoolCollection.js b/lib/services/websiteManagement2/lib/models/workerPoolCollection.js new file mode 100644 index 0000000000..a2595a2197 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/workerPoolCollection.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 worker pools. + */ +class WorkerPoolCollection extends Array { + /** + * Create a WorkerPoolCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WorkerPoolCollection + * + * @returns {object} metadata of WorkerPoolCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'WorkerPoolCollection', + type: { + name: 'Composite', + className: 'WorkerPoolCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WorkerPoolResourceElementType', + type: { + name: 'Composite', + className: 'WorkerPoolResource' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WorkerPoolCollection; diff --git a/lib/services/websiteManagement2/lib/models/workerPoolResource.js b/lib/services/websiteManagement2/lib/models/workerPoolResource.js new file mode 100644 index 0000000000..b8da1fe66f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/workerPoolResource.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'); + +/** + * Worker pool of an App Service Environment ARM resource. + * + * @extends models['ProxyOnlyResource'] + */ +class WorkerPoolResource extends models['ProxyOnlyResource'] { + /** + * Create a WorkerPoolResource. + * @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? + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WorkerPoolResource + * + * @returns {object} metadata of WorkerPoolResource + * + */ + mapper() { + return { + required: false, + serializedName: 'WorkerPoolResource', + type: { + name: 'Composite', + className: 'WorkerPoolResource', + 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' + } + }, + workerSizeId: { + required: false, + serializedName: 'properties.workerSizeId', + type: { + name: 'Number' + } + }, + computeMode: { + required: false, + serializedName: 'properties.computeMode', + type: { + name: 'Enum', + allowedValues: [ 'Shared', 'Dedicated', 'Dynamic' ] + } + }, + workerSize: { + required: false, + serializedName: 'properties.workerSize', + type: { + name: 'String' + } + }, + workerCount: { + required: false, + serializedName: 'properties.workerCount', + type: { + name: 'Number' + } + }, + instanceNames: { + required: false, + readOnly: true, + serializedName: 'properties.instanceNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'SkuDescription' + } + } + } + } + }; + } +} + +module.exports = WorkerPoolResource; 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..8f99c59f4f --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/appServicePlans.js @@ -0,0 +1,10631 @@ +/* + * 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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..e793a9fa19 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -0,0 +1,60006 @@ +/* + * 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers that 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers that 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the 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 {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. + */ + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 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. + */ + startWebSiteNetworkTraceOperationWithHttpOperationResponse(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 {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. + */ + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperation(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 {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. + */ + 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getNetworkTracesWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the 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 {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. + */ + getNetworkTraces(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraces(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; + getNetworkTraces(resourceGroupName: string, name: string, operationId: 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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. + */ + getNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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. + */ + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 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. + */ + startWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(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 {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. + */ + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperationSlot(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 {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. + */ + 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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. + */ + getNetworkTracesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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. + */ + getNetworkTracesSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTracesSlot(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; + getNetworkTracesSlot(resourceGroupName: string, name: string, operationId: 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 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. + */ + beginStartWebSiteNetworkTraceOperationWithHttpOperationResponse(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 {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. + */ + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, 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 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. + */ + beginStartWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(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 {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. + */ + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 {number} [appServicePlan.maximumElasticWorkerCount] Maximum number of + * total workers allowed for this ElasticScaleEnabled App Service 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 new file mode 100644 index 0000000000..395fd6cbd2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/index.js @@ -0,0 +1,30 @@ +/* + * 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'; + +exports.AppServiceCertificateOrders = require('./appServiceCertificateOrders'); +exports.CertificateRegistrationProvider = require('./certificateRegistrationProvider'); +exports.Domains = require('./domains'); +exports.TopLevelDomains = require('./topLevelDomains'); +exports.DomainRegistrationProvider = require('./domainRegistrationProvider'); +exports.Certificates = require('./certificates'); +exports.DeletedWebApps = require('./deletedWebApps'); +exports.Diagnostics = require('./diagnostics'); +exports.Provider = require('./provider'); +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..243f5f22f9 --- /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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers 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', 'WindowsFunctions', 'LinuxFunctions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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..d9aff806fe --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -0,0 +1,126902 @@ +/* + * 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getNetworkTraceOperation(resourceGroupName, name, operationId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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/operationresults/{operationId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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 !== 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['Operation']().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 Start capturing network packets for the site (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 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. + * + * {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 _startWebSiteNetworkTraceOperation(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.beginStartWebSiteNetworkTraceOperation(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 = { + 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 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. + * + * {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 _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 && 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 a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the 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. + * + * {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 _getNetworkTraces(resourceGroupName, name, operationId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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/{operationId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.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: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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 _getNetworkTraceOperationSlot(resourceGroupName, name, operationId, 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 (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId 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/operationresults/{operationId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); + 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 !== 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['Operation']().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 Start capturing network packets for the site (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 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. + * + * {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 _startWebSiteNetworkTraceOperationSlot(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.beginStartWebSiteNetworkTraceOperationSlot(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 = { + 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 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. + * + * {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 _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 && 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 a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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 _getNetworkTracesSlot(resourceGroupName, name, operationId, 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 (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId 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/{operationId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); + 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: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 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. + * + * {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 _beginStartWebSiteNetworkTraceOperation(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/startOperation'; + 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 && 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['Operation']().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 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 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. + * + * {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 _beginStartWebSiteNetworkTraceOperationSlot(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/startOperation'; + 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 && 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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['Operation']().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 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._getNetworkTraceOperation = _getNetworkTraceOperation; + this._startWebSiteNetworkTrace = _startWebSiteNetworkTrace; + this._startWebSiteNetworkTraceOperation = _startWebSiteNetworkTraceOperation; + this._stopWebSiteNetworkTrace = _stopWebSiteNetworkTrace; + this._getNetworkTraces = _getNetworkTraces; + 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._getNetworkTraceOperationSlot = _getNetworkTraceOperationSlot; + this._startWebSiteNetworkTraceSlot = _startWebSiteNetworkTraceSlot; + this._startWebSiteNetworkTraceOperationSlot = _startWebSiteNetworkTraceOperationSlot; + this._stopWebSiteNetworkTraceSlot = _stopWebSiteNetworkTraceSlot; + this._getNetworkTracesSlot = _getNetworkTracesSlot; + 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._beginStartWebSiteNetworkTraceOperation = _beginStartWebSiteNetworkTraceOperation; + 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._beginStartWebSiteNetworkTraceOperationSlot = _beginStartWebSiteNetworkTraceOperationSlot; + 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getNetworkTraceOperationWithHttpOperationResponse(resourceGroupName, name, operationId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getNetworkTraceOperation(resourceGroupName, name, operationId, 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 operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the 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 {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. + */ + getNetworkTraceOperation(resourceGroupName, name, operationId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNetworkTraceOperation(resourceGroupName, name, operationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNetworkTraceOperation(resourceGroupName, name, operationId, options, optionalCallback); + } + } + + /** + * @summary Start capturing network packets for the site (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 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. + */ + startWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTraceOperation(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 {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. + */ + startWebSiteNetworkTraceOperation(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._startWebSiteNetworkTraceOperation(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startWebSiteNetworkTraceOperation(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 {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. + */ + 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getNetworkTracesWithHttpOperationResponse(resourceGroupName, name, operationId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getNetworkTraces(resourceGroupName, name, operationId, 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 operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the 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 {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. + */ + getNetworkTraces(resourceGroupName, name, operationId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNetworkTraces(resourceGroupName, name, operationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNetworkTraces(resourceGroupName, name, operationId, 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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. + */ + getNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName, name, operationId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getNetworkTraceOperationSlot(resourceGroupName, name, operationId, 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 operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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. + */ + getNetworkTraceOperationSlot(resourceGroupName, name, operationId, 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._getNetworkTraceOperationSlot(resourceGroupName, name, operationId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNetworkTraceOperationSlot(resourceGroupName, name, operationId, slot, options, optionalCallback); + } + } + + /** + * @summary Start capturing network packets for the site (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 (To be deprecated). + * + * Start capturing network packets for the site (To be deprecated). + * + * @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 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. + */ + startWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTraceOperationSlot(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 {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. + */ + startWebSiteNetworkTraceOperationSlot(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._startWebSiteNetworkTraceOperationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startWebSiteNetworkTraceOperationSlot(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 {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. + */ + 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 Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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. + */ + getNetworkTracesSlotWithHttpOperationResponse(resourceGroupName, name, operationId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getNetworkTracesSlot(resourceGroupName, name, operationId, 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 operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation 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. + */ + getNetworkTracesSlot(resourceGroupName, name, operationId, 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._getNetworkTracesSlot(resourceGroupName, name, operationId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNetworkTracesSlot(resourceGroupName, name, operationId, 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 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. + */ + beginStartWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStartWebSiteNetworkTraceOperation(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 {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. + */ + beginStartWebSiteNetworkTraceOperation(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._beginStartWebSiteNetworkTraceOperation(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStartWebSiteNetworkTraceOperation(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. + */ + 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 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. + */ + beginStartWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStartWebSiteNetworkTraceOperationSlot(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 {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. + */ + beginStartWebSiteNetworkTraceOperationSlot(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._beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStartWebSiteNetworkTraceOperationSlot(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. + */ + 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..a8ea986272 --- /dev/null +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -0,0 +1,1524 @@ +/* + * 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', 'ElasticPremium', 'ElasticIsolated' + * + * @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 {boolean} [options.linuxDynamicWorkersEnabled] Specify + * true if you want to filter to only regions that support Linux + * Consumption 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, linuxDynamicWorkersEnabled? : 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', 'ElasticPremium', 'ElasticIsolated' + * + * @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 {boolean} [options.linuxDynamicWorkersEnabled] Specify + * true if you want to filter to only regions that support Linux + * Consumption 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, linuxDynamicWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listGeoRegions(callback: ServiceCallback): void; + listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, linuxDynamicWorkersEnabled? : 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..72bc864f4b --- /dev/null +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -0,0 +1,5301 @@ +/* + * 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', 'ElasticPremium', 'ElasticIsolated' + * + * @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 {boolean} [options.linuxDynamicWorkersEnabled] Specify + * true if you want to filter to only regions that support Linux + * Consumption 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; + let linuxDynamicWorkersEnabled = (options && options.linuxDynamicWorkersEnabled !== undefined) ? options.linuxDynamicWorkersEnabled : 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 (linuxDynamicWorkersEnabled !== null && linuxDynamicWorkersEnabled !== undefined && typeof linuxDynamicWorkersEnabled !== 'boolean') { + throw new Error('linuxDynamicWorkersEnabled 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())); + } + if (linuxDynamicWorkersEnabled !== null && linuxDynamicWorkersEnabled !== undefined) { + queryParameters.push('linuxDynamicWorkersEnabled=' + encodeURIComponent(linuxDynamicWorkersEnabled.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', 'ElasticPremium', 'ElasticIsolated' + * + * @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 {boolean} [options.linuxDynamicWorkersEnabled] Specify + * true if you want to filter to only regions that support Linux + * Consumption 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', 'ElasticPremium', 'ElasticIsolated' + * + * @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 {boolean} [options.linuxDynamicWorkersEnabled] Specify + * true if you want to filter to only regions that support Linux + * Consumption 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..356e4ea1b3 --- /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": "5.3.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", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-node/issues" + } +}